diff --git a/modules/justpremiumBidAdapter.js b/modules/justpremiumBidAdapter.js index a7aebae0fd9..10a301a522c 100644 --- a/modules/justpremiumBidAdapter.js +++ b/modules/justpremiumBidAdapter.js @@ -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 = { @@ -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 @@ -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', diff --git a/test/spec/modules/justpremiumBidAdapter_spec.js b/test/spec/modules/justpremiumBidAdapter_spec.js index b16586d0e14..3b34799f36d 100644 --- a/test/spec/modules/justpremiumBidAdapter_spec.js +++ b/test/spec/modules/justpremiumBidAdapter_spec.js @@ -44,6 +44,7 @@ describe('justpremium adapter', function () { ] let bidderRequest = { + uspConsent: '1YYN', refererInfo: { referer: 'https://justpremium.com' } @@ -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') }) }) @@ -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/) }) }) })