Skip to content

Commit

Permalink
Kargo Bid Adapter: Support for sending ortb2.user.data (prebid#10659)
Browse files Browse the repository at this point in the history
* KargoBidAdapter: GPP Support

* kargo adapter to forward schain object (#21)

* wrap in if statement (#22)

* KRKPD-572: Add spec for schain (#23)

* wrap in if statement

* update test for schain, file formatting

* Adding site to Kargo adapter.

* KRKPD-619 Updating Site object.

* KRKPD-619 Adding null check for  Site object.

* Update modules/kargoBidAdapter.js

Co-authored-by: Julian Gan  <[email protected]>

* Reducing the size of Site object.

* remove white space that is causing linting error

* Kargo Bid Adapter: Updates to gpid retrieval

* Support for sending ortb2.user.data

---------

Co-authored-by: Julian Gan <[email protected]>
Co-authored-by: Neil Flynn <[email protected]>
  • Loading branch information
3 people authored Oct 30, 2023
1 parent 56292c4 commit a94f7f0
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
6 changes: 6 additions & 0 deletions modules/kargoBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const CURRENCY = Object.freeze({
});

const REQUEST_KEYS = Object.freeze({
USER_DATA: 'ortb2.user.data',
SOCIAL_CANVAS: 'params.socialCanvas',
SUA: 'ortb2.device.sua',
TDID_ADAPTER: 'userId.tdid',
Expand Down Expand Up @@ -103,15 +104,20 @@ function buildRequests(validBidRequests, bidderRequest) {
}
}

// Add schain
if (firstBidRequest.schain && firstBidRequest.schain.nodes) {
krakenParams.schain = firstBidRequest.schain
}

// Add user data object if available
krakenParams.user.data = deepAccess(firstBidRequest, REQUEST_KEYS.USER_DATA) || [];

const reqCount = getRequestCount()
if (reqCount != null) {
krakenParams.requestCount = reqCount;
}

// Add currency if not USD
if (currency != null && currency != CURRENCY.US_DOLLAR) {
krakenParams.cur = currency;
}
Expand Down
30 changes: 30 additions & 0 deletions test/spec/modules/kargoBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,22 @@ describe('kargo adapter tests', function () {
id: '1234',
name: 'SiteName',
cat: ['IAB1', 'IAB2', 'IAB3']
},
user: {
data: [
{
name: 'prebid.org',
ext: {
segtax: 600,
segclass: 'v1',
},
segment: [
{
id: '133'
},
]
},
]
}
},
ortb2Imp: {
Expand Down Expand Up @@ -522,6 +538,20 @@ describe('kargo adapter tests', function () {
}
]
}
],
data: [
{
name: 'prebid.org',
ext: {
segtax: 600,
segclass: 'v1',
},
segment: [
{
id: '133'
}
]
}
]
}
};
Expand Down

0 comments on commit a94f7f0

Please sign in to comment.