diff --git a/modules/kargoBidAdapter.js b/modules/kargoBidAdapter.js index 72342903d87..deeb1cb8630 100644 --- a/modules/kargoBidAdapter.js +++ b/modules/kargoBidAdapter.js @@ -60,7 +60,7 @@ export const spec = { height: window.screen.height }, prebidRawBidRequests: validBidRequests - }, spec._getAllMetadata(tdid, bidderRequest.uspConsent, bidderRequest.gdprConsent)); + }, spec._getAllMetadata(bidderRequest, tdid)); const encodedParams = encodeURIComponent(JSON.stringify(transformedParams)); return Object.assign({}, bidderRequest, { method: 'GET', @@ -215,11 +215,10 @@ export const spec = { return crb.clientId; }, - _getAllMetadata(tdid, usp, gdpr) { + _getAllMetadata(bidderRequest, tdid) { return { - userIDs: spec._getUserIds(tdid, usp, gdpr), - // TODO: this should probably look at refererInfo - pageURL: window.location.href, + userIDs: spec._getUserIds(tdid, bidderRequest.uspConsent, bidderRequest.gdprConsent), + pageURL: bidderRequest.refererInfo && bidderRequest.refererInfo.page, rawCRB: storage.getCookie('krg_crb'), rawCRBLocalStorage: spec._getLocalStorageSafely('krg_crb') }; diff --git a/test/spec/modules/kargoBidAdapter_spec.js b/test/spec/modules/kargoBidAdapter_spec.js index e900b91ed11..169ee520f33 100644 --- a/test/spec/modules/kargoBidAdapter_spec.js +++ b/test/spec/modules/kargoBidAdapter_spec.js @@ -276,7 +276,7 @@ describe('kargo adapter tests', function () { optOut: false, usp: '1---' }, - pageURL: window.location.href, + pageURL: 'https://www.prebid.org', prebidRawBidRequests: [ { bidId: 1, @@ -327,10 +327,19 @@ describe('kargo adapter tests', function () { if (excludeTdid) { delete clonedBids[0].userId.tdid; } - var payload = { timeout: 200, uspConsent: '1---', foo: 'bar' }; + var payload = { + timeout: 200, + uspConsent: '1---', + foo: 'bar', + refererInfo: { + page: 'https://www.prebid.org', + }, + }; + if (gdpr) { payload['gdprConsent'] = gdpr } + var request = spec.buildRequests(clonedBids, payload); expected.sessionId = getSessionId(); sessionIds.push(expected.sessionId);