Skip to content

Commit

Permalink
PubMaticBidAdapter: Send Consent string to userSync endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
pm-dattaprasad-mundada committed Apr 19, 2018
1 parent 807678f commit b44b9a8
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions modules/pubmaticBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,11 +290,19 @@ export const spec = {
/**
* Register User Sync.
*/
getUserSyncs: syncOptions => {
getUserSyncs: (syncOptions, responses, gdprConsent) => {
let syncurl = USYNCURL + publisherId;

// Attaching GDPR Consent Params in UserSync url
if (gdprConsent) {
syncurl += '&gdpr=' + (gdprConsent.consentRequired ? 1 : 0);

This comment has been minimized.

Copy link
@pm-harshad-mane

pm-harshad-mane Apr 19, 2018

Collaborator

there might be case where inventory is GDPR compliant but the consent yet not given by user so better remove gdpr flag out of if(gdprConsent) condition

I think there is no need of if(gdprConsent) condition as you are setting a default value to consent param if gdprConsent is not passed, so we can remove the if condition.

This comment has been minimized.

Copy link
@PubMatic-OpenWrap

PubMatic-OpenWrap Apr 19, 2018

Owner

No gdprConsent is object which includes { consenString, consentRequired }.
If publisher dosen't explicitly use consentmanagement that's only condition where it will skip if(gdprConsent) is undefined.
In all other cases either whether consentString present or not & consent given or not it will attach the params

This comment has been minimized.

Copy link
@pm-harshad-mane

pm-harshad-mane Apr 19, 2018

Collaborator

Agree. LGTM.

syncurl += '&consent=' + encodeURIComponent(gdprConsent.consentString || '');
}

if (syncOptions.iframeEnabled) {
return [{
type: 'iframe',
url: USYNCURL + publisherId
url: syncurl
}];
} else {
utils.logWarn('PubMatic: Please enable iframe based user sync.');
Expand Down

0 comments on commit b44b9a8

Please sign in to comment.