Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ID5 ID module - pass gdpr and usp parameters in body instead of querystring #6032

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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