Skip to content
Open
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
6 changes: 3 additions & 3 deletions modules/kargoBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ function getUserSyncs(syncOptions, _, gdprConsent, usPrivacy, gppConsent) {
var gdpr = (gdprConsent && gdprConsent.gdprApplies) ? 1 : 0;
var gdprConsentString = (gdprConsent && gdprConsent.consentString) ? gdprConsent.consentString : '';

var gppString = (gppConsent && gppConsent.consentString) ? gppConsent.consentString : '';
var gppString = (gppConsent && gppConsent.gppString) ? gppConsent.gppString : '';
var gppApplicableSections = (gppConsent && gppConsent.applicableSections && Array.isArray(gppConsent.applicableSections)) ? gppConsent.applicableSections.join(',') : '';

// don't sync if opted out via usPrivacy
Expand Down Expand Up @@ -413,8 +413,8 @@ function getUserIds(tdidAdapter, usp, gdpr, eids, gpp) {
// GPP
if (gpp) {
const parsedGPP = {};
if (gpp.consentString) {
parsedGPP.gppString = gpp.consentString;
if (gpp.gppString) {
parsedGPP.gppString = gpp.gppString;
}
if (gpp.applicableSections) {
parsedGPP.applicableSections = gpp.applicableSections;
Expand Down
18 changes: 9 additions & 9 deletions test/spec/modules/kargoBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1253,7 +1253,7 @@ describe('kargo adapter tests', function() {

it('fetches gpp from the bidder request if present', function() {
bidderRequest.gppConsent = {
consentString: 'gppString',
gppString: 'gppString',
applicableSections: [-1]
};
const payload = getPayloadFromTestBids([{ ...minimumBidParams }]);
Expand All @@ -1266,7 +1266,7 @@ describe('kargo adapter tests', function() {

it('does not send empty gpp values', function() {
bidderRequest.gppConsent = {
consentString: '',
gppString: '',
applicableSections: ''
};
const payload = getPayloadFromTestBids([{ ...minimumBidParams }]);
Expand Down Expand Up @@ -2045,13 +2045,13 @@ describe('kargo adapter tests', function() {

it('includes gpp information if provided', function() {
[
{ applicableSections: [-1], consentString: 'test-consent-string', as: '-1', cs: 'test-consent-string' },
{ applicableSections: [1, 2, 3], consentString: 'test-consent-string', as: '1,2,3', cs: 'test-consent-string' },
{ applicableSections: [-1], gppString: 'test-consent-string', as: '-1', cs: 'test-consent-string' },
{ applicableSections: [1, 2, 3], gppString: 'test-consent-string', as: '1,2,3', cs: 'test-consent-string' },
{ applicableSections: [-1], as: '-1', cs: '' },
{ applicableSections: false, consentString: 'test-consent-string', as: '', cs: 'test-consent-string' },
{ applicableSections: null, consentString: 'test-consent-string', as: '', cs: 'test-consent-string' },
{ applicableSections: {}, consentString: 'test-consent-string', as: '', cs: 'test-consent-string' },
{ applicableSections: [], consentString: 'test-consent-string', as: '', cs: 'test-consent-string' },
{ applicableSections: false, gppString: 'test-consent-string', as: '', cs: 'test-consent-string' },
{ applicableSections: null, gppString: 'test-consent-string', as: '', cs: 'test-consent-string' },
{ applicableSections: {}, gppString: 'test-consent-string', as: '', cs: 'test-consent-string' },
{ applicableSections: [], gppString: 'test-consent-string', as: '', cs: 'test-consent-string' },
{ as: '', cs: '' },
].forEach(value => expect(getUserSyncs(undefined, undefined, value), `Value - ${value}`)
.to.deep.equal(buildSyncUrls(baseUrl
Expand All @@ -2077,7 +2077,7 @@ describe('kargo adapter tests', function() {
expect(getUserSyncs(
{ gdprApplies: true, consentString: 'test-gdpr-consent' },
'1---',
{ applicableSections: [1, 2, 3], consentString: 'test-gpp-consent' }
{ applicableSections: [1, 2, 3], gppString: 'test-gpp-consent' }
)).to.deep.equal(buildSyncUrls(baseUrl
.replace(/gdpr=\d/, 'gdpr=1')
.replace(/gdpr_consent=/, 'gdpr_consent=test-gdpr-consent')
Expand Down