forked from prebid/Prebid.js
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PubMaticBidAdapter: Send Consent string to userSync endpoint
- Loading branch information
1 parent
807678f
commit b44b9a8
Showing
1 changed file
with
10 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
PubMatic-OpenWrap
Owner
|
||
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.'); | ||
|
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.