Skip to content

Commit

Permalink
ID5 ID module - pass gdpr and usp parameters in body instead of query…
Browse files Browse the repository at this point in the history
…string (#6032)

* move gdpr and usp parameters to the body rather than the querystring of calls to ID5

* remove unnecessary variables
  • Loading branch information
smenzer authored Nov 30, 2020
1 parent 57ef24a commit 4638dff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 4 additions & 3 deletions modules/id5IdSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@ export const id5IdSubmodule = {
return undefined;
}

const url = `https://id5-sync.com/g/v2/${config.params.partner}.json`;
const hasGdpr = (consentData && typeof consentData.gdprApplies === 'boolean' && consentData.gdprApplies) ? 1 : 0;
const gdprConsentString = hasGdpr ? consentData.consentString : '';
const usp = uspDataHandler.getConsentData() || '';
const url = `https://id5-sync.com/g/v2/${config.params.partner}.json?gdpr_consent=${gdprConsentString}&gdpr=${hasGdpr}&us_privacy=${usp}`;
const referer = getRefererInfo();
const signature = (cacheIdObj && cacheIdObj.signature) ? cacheIdObj.signature : getLegacyCookieSignature();
const data = {
'gdpr': hasGdpr,
'gdpr_consent': hasGdpr ? consentData.consentString : '',
'partner': config.params.partner,
'nbPage': incrementNb(config.params.partner),
'o': 'pbjs',
Expand All @@ -94,6 +94,7 @@ export const id5IdSubmodule = {
's': signature,
'top': referer.reachedTop ? 1 : 0,
'u': referer.stack[0] || window.location.href,
'us_privacy': uspDataHandler.getConsentData() || '',
'v': '$prebid.version$'
};

Expand Down
3 changes: 3 additions & 0 deletions test/spec/modules/id5IdSystem_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ describe('ID5 ID System', function() {
expect(requestBody.s).to.eq('');
expect(requestBody.provider).to.eq('');
expect(requestBody.v).to.eq('$prebid.version$');
expect(requestBody.gdpr).to.exist;
expect(requestBody.gdpr_consent).to.exist
expect(requestBody.us_privacy).to.exist;

request.respond(200, responseHeader, JSON.stringify(ID5_JSON_RESPONSE));
expect(callbackSpy.calledOnce).to.be.true;
Expand Down

0 comments on commit 4638dff

Please sign in to comment.