Skip to content

Commit 6b0021c

Browse files
jsadwithwwongkargoandyrusiecki
authored
Kargo Bid Adapter: Pull Page URL from refererInfo (prebid#8825)
* Kargo Bid Adapter: Use currency from Bid Response * Kargo Bid Adapter: Fix failed test * Kargo Bid Adapter: adding media type to bid response, supporting vastXml response (prebid#8426) * kargo adapter - adding mediaType to bid response, conditionally set vastXml field * kargo adapter - updating tests * Kargo Bid Adapter: onTimeout Support (#6) * Adding additional param * Adding response time function * Remove debug * Updating response time log to be set by bid response * Adding screen width/height to request * Test fix * Test fix * Removing interpretResponse signaling * Simplifying send data function * Kargo Analytics Adapter: Update with bid response time support * Renaming event route for auction data * Reset bid response data sent bool * Using array to store logged auctions * Update to use timeToResponse * Test fix * Kargo: Pull page URL from refererInfo * Test fix: Page URL * Removing extra bracket Co-authored-by: Wei Wong <[email protected]> Co-authored-by: Andy Rusiecki <[email protected]>
1 parent 335a907 commit 6b0021c

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

modules/kargoBidAdapter.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export const spec = {
6060
height: window.screen.height
6161
},
6262
prebidRawBidRequests: validBidRequests
63-
}, spec._getAllMetadata(tdid, bidderRequest.uspConsent, bidderRequest.gdprConsent));
63+
}, spec._getAllMetadata(bidderRequest, tdid));
6464
const encodedParams = encodeURIComponent(JSON.stringify(transformedParams));
6565
return Object.assign({}, bidderRequest, {
6666
method: 'GET',
@@ -215,11 +215,10 @@ export const spec = {
215215
return crb.clientId;
216216
},
217217

218-
_getAllMetadata(tdid, usp, gdpr) {
218+
_getAllMetadata(bidderRequest, tdid) {
219219
return {
220-
userIDs: spec._getUserIds(tdid, usp, gdpr),
221-
// TODO: this should probably look at refererInfo
222-
pageURL: window.location.href,
220+
userIDs: spec._getUserIds(tdid, bidderRequest.uspConsent, bidderRequest.gdprConsent),
221+
pageURL: bidderRequest.refererInfo && bidderRequest.refererInfo.page,
223222
rawCRB: storage.getCookie('krg_crb'),
224223
rawCRBLocalStorage: spec._getLocalStorageSafely('krg_crb')
225224
};

test/spec/modules/kargoBidAdapter_spec.js

+11-2
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ describe('kargo adapter tests', function () {
276276
optOut: false,
277277
usp: '1---'
278278
},
279-
pageURL: window.location.href,
279+
pageURL: 'https://www.prebid.org',
280280
prebidRawBidRequests: [
281281
{
282282
bidId: 1,
@@ -327,10 +327,19 @@ describe('kargo adapter tests', function () {
327327
if (excludeTdid) {
328328
delete clonedBids[0].userId.tdid;
329329
}
330-
var payload = { timeout: 200, uspConsent: '1---', foo: 'bar' };
330+
var payload = {
331+
timeout: 200,
332+
uspConsent: '1---',
333+
foo: 'bar',
334+
refererInfo: {
335+
page: 'https://www.prebid.org',
336+
},
337+
};
338+
331339
if (gdpr) {
332340
payload['gdprConsent'] = gdpr
333341
}
342+
334343
var request = spec.buildRequests(clonedBids, payload);
335344
expected.sessionId = getSessionId();
336345
sessionIds.push(expected.sessionId);

0 commit comments

Comments
 (0)