Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Justpremium: support for us privacy (CCPA) - legacy #4665

Merged
Merged
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
11 changes: 9 additions & 2 deletions modules/justpremiumBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { deepAccess } from '../src/utils';

const BIDDER_CODE = 'justpremium'
const ENDPOINT_URL = 'https://pre.ads.justpremium.com/v/2.0/t/xhr'
const JP_ADAPTER_VERSION = '1.6'
const JP_ADAPTER_VERSION = '1.7'
const pixels = []

export const spec = {
Expand Down Expand Up @@ -54,6 +54,10 @@ export const spec = {
}
}

if (bidderRequest && bidderRequest.uspConsent) {
payload.us_privacy = bidderRequest.uspConsent
}

payload.version = {
prebid: '$prebid.version$',
jp_adapter: JP_ADAPTER_VERSION
Expand Down Expand Up @@ -94,11 +98,14 @@ export const spec = {
return bidResponses
},

getUserSyncs: function getUserSyncs(syncOptions, responses, gdprConsent) {
getUserSyncs: function getUserSyncs(syncOptions, responses, gdprConsent, uspConsent) {
let url = 'https://pre.ads.justpremium.com/v/1.0/t/sync' + '?_c=' + 'a' + Math.random().toString(36).substring(7) + Date.now();
if (gdprConsent && (typeof gdprConsent.gdprApplies === 'boolean')) {
url = url + '&consentString=' + encodeURIComponent(gdprConsent.consentString)
}
if (uspConsent) {
url = url + '&usPrivacy=' + encodeURIComponent(uspConsent)
}
if (syncOptions.iframeEnabled) {
pixels.push({
type: 'iframe',
Expand Down
8 changes: 6 additions & 2 deletions test/spec/modules/justpremiumBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ describe('justpremium adapter', function () {
]

let bidderRequest = {
uspConsent: '1YYN',
refererInfo: {
referer: 'https://justpremium.com'
}
Expand Down Expand Up @@ -80,11 +81,12 @@ describe('justpremium adapter', function () {
expect(jpxRequest.id).to.equal(adUnits[0].params.zone)
expect(jpxRequest.mediaTypes && jpxRequest.mediaTypes.banner && jpxRequest.mediaTypes.banner.sizes).to.not.equal('undefined')
expect(jpxRequest.version.prebid).to.equal('$prebid.version$')
expect(jpxRequest.version.jp_adapter).to.equal('1.6')
expect(jpxRequest.version.jp_adapter).to.equal('1.7')
expect(jpxRequest.pubcid).to.equal('0000000')
expect(jpxRequest.uids.tdid).to.equal('1111111')
expect(jpxRequest.uids.id5id).to.equal('2222222')
expect(jpxRequest.uids.digitrustid.data.id).to.equal('3333333')
expect(jpxRequest.us_privacy).to.equal('1YYN')
})
})

Expand Down Expand Up @@ -155,10 +157,12 @@ describe('justpremium adapter', function () {

describe('getUserSyncs', function () {
it('Verifies sync options', function () {
const options = spec.getUserSyncs({iframeEnabled: true})
const options = spec.getUserSyncs({iframeEnabled: true}, {}, {gdprApplies: true, consentString: 'BOOgjO9OOgjO9APABAENAi-AAAAWd'}, '1YYN')
expect(options).to.not.be.undefined
expect(options[0].type).to.equal('iframe')
expect(options[0].url).to.match(/\/\/pre.ads.justpremium.com\/v\/1.0\/t\/sync/)
expect(options[0].url).to.match(/&consentString=BOOgjO9OOgjO9APABAENAi-AAAAWd/)
expect(options[0].url).to.match(/&usPrivacy=1YYN/)
})
})
})