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: 5 additions & 1 deletion modules/sovrnBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ export const spec = {
}
},

getUserSyncs: function(syncOptions, serverResponses, gdprConsent, uspConsent) {
getUserSyncs: function(syncOptions, serverResponses, gdprConsent, uspConsent, gppConsent) {
try {
const tracks = []
if (serverResponses && serverResponses.length !== 0) {
Expand All @@ -262,6 +262,10 @@ export const spec = {
if (uspConsent) {
params.push(['us_privacy', uspConsent]);
}
if (gppConsent) {
params.push(['gpp', gppConsent.gppString]);
params.push(['gpp_sid', gppConsent.applicableSections])
}

if (iidArr[0]) {
params.push(['informer', iidArr[0]]);
Expand Down
28 changes: 24 additions & 4 deletions test/spec/modules/sovrnBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,7 @@ describe('sovrnBidAdapter', function() {
url: `https://ap.lijit.com/beacon?gdpr_consent=${gdprConsent.consentString}&informer=13487408`,
}

const returnStatement = spec.getUserSyncs(syncOptions, serverResponse, gdprConsent, '')
const returnStatement = spec.getUserSyncs(syncOptions, serverResponse, gdprConsent, '', null)

expect(returnStatement[0]).to.deep.equal(expectedReturnStatement)
})
Expand All @@ -863,7 +863,22 @@ describe('sovrnBidAdapter', function() {
url: `https://ap.lijit.com/beacon?us_privacy=${uspString}&informer=13487408`,
}

const returnStatement = spec.getUserSyncs(syncOptions, serverResponse, null, uspString)
const returnStatement = spec.getUserSyncs(syncOptions, serverResponse, null, uspString, null)

expect(returnStatement[0]).to.deep.equal(expectedReturnStatement)
})

it('should include gpp consent string if present', function() {
const gppConsent = {
applicableSections: [1, 2],
gppString: 'DBACNYA~CPXxRfAPXxRfAAfKABENB-CgAAAAAAAAAAYgAAAAAAAA~1YNN'
}
const expectedReturnStatement = {
type: 'iframe',
url: `https://ap.lijit.com/beacon?gpp=${gppConsent.gppString}&gpp_sid=${gppConsent.applicableSections}&informer=13487408`,
}

const returnStatement = spec.getUserSyncs(syncOptions, serverResponse, null, '', gppConsent)

expect(returnStatement[0]).to.deep.equal(expectedReturnStatement)
})
Expand All @@ -874,12 +889,17 @@ describe('sovrnBidAdapter', function() {
consentString: 'BOJ8RZsOJ8RZsABAB8AAAAAZ+A=='
}
const uspString = '1NYN'
const gppConsent = {
applicableSections: [1, 2],
gppString: 'DBACNYA~CPXxRfAPXxRfAAfKABENB-CgAAAAAAAAAAYgAAAAAAAA~1YNN'
}

const expectedReturnStatement = {
type: 'iframe',
url: `https://ap.lijit.com/beacon?gdpr_consent=${gdprConsent.consentString}&us_privacy=${uspString}&informer=13487408`,
url: `https://ap.lijit.com/beacon?gdpr_consent=${gdprConsent.consentString}&us_privacy=${uspString}&gpp=${gppConsent.gppString}&gpp_sid=${gppConsent.applicableSections}&informer=13487408`,
}

const returnStatement = spec.getUserSyncs(syncOptions, serverResponse, gdprConsent, uspString)
const returnStatement = spec.getUserSyncs(syncOptions, serverResponse, gdprConsent, uspString, gppConsent)

expect(returnStatement[0]).to.deep.equal(expectedReturnStatement)
})
Expand Down