Skip to content

Commit

Permalink
Kargo Bid Adapter: Pull Page URL from refererInfo (prebid#8825)
Browse files Browse the repository at this point in the history
* 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 (prebid#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 <wwong@kargo.com>
Co-authored-by: Andy Rusiecki <andy.rusiecki@gmail.com>
  • Loading branch information
3 people authored and JacobKlein26 committed Feb 8, 2023
1 parent 465e514 commit 952557a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
9 changes: 4 additions & 5 deletions modules/kargoBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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')
};
Expand Down
13 changes: 11 additions & 2 deletions test/spec/modules/kargoBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 952557a

Please sign in to comment.