Skip to content

Commit

Permalink
add gpp support on Smartyads adapter (prebid#10163)
Browse files Browse the repository at this point in the history
Co-authored-by: Vasyl Rishko <vasyl.rishko@smartyads.com>
  • Loading branch information
2 people authored and Santiago Carabone committed Aug 22, 2023
1 parent 7e39bdd commit 4ace04b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions modules/smartyadsBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ export const spec = {
if (bidderRequest.gdprConsent) {
request.gdpr = bidderRequest.gdprConsent
}
if (bidderRequest.gppConsent) {
request.gpp = bidderRequest.gppConsent;
}
}
const len = validBidRequests.length;

Expand Down Expand Up @@ -102,19 +105,19 @@ export const spec = {
return response;
},

getUserSyncs: (syncOptions, serverResponses = [], gdprConsent = {}, uspConsent = '') => {
getUserSyncs: (syncOptions, serverResponses = [], gdprConsent = {}, uspConsent = '', gppConsent = '') => {
let syncs = [];
let { gdprApplies, consentString = '' } = gdprConsent;

if (syncOptions.iframeEnabled) {
syncs.push({
type: 'iframe',
url: `${URL_SYNC}&gdpr=${gdprApplies ? 1 : 0}&gdpr_consent=${consentString}&type=iframe&us_privacy=${uspConsent}`
url: `${URL_SYNC}&gdpr=${gdprApplies ? 1 : 0}&gdpr_consent=${consentString}&type=iframe&us_privacy=${uspConsent}&gpp=${gppConsent}`
});
} else {
syncs.push({
type: 'image',
url: `${URL_SYNC}&gdpr=${gdprApplies ? 1 : 0}&gdpr_consent=${consentString}&type=image&us_privacy=${uspConsent}`
url: `${URL_SYNC}&gdpr=${gdprApplies ? 1 : 0}&gdpr_consent=${consentString}&type=image&us_privacy=${uspConsent}&gpp=${gppConsent}`
});
}

Expand Down
2 changes: 1 addition & 1 deletion test/spec/modules/smartyadsBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ describe('SmartyadsAdapter', function () {
});
});
describe('getUserSyncs', function () {
const syncUrl = 'https://as.ck-ie.com/prebidjs?p=7c47322e527cf8bdeb7facc1bb03387a&gdpr=0&gdpr_consent=&type=iframe&us_privacy=';
const syncUrl = 'https://as.ck-ie.com/prebidjs?p=7c47322e527cf8bdeb7facc1bb03387a&gdpr=0&gdpr_consent=&type=iframe&us_privacy=&gpp=';
const syncOptions = {
iframeEnabled: true
};
Expand Down

0 comments on commit 4ace04b

Please sign in to comment.