Skip to content

Commit

Permalink
StroeerCore Bid Adapter: support transaction ids
Browse files Browse the repository at this point in the history
  • Loading branch information
philipwatson committed May 30, 2024
1 parent 2a11898 commit a99e1ee
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
5 changes: 3 additions & 2 deletions modules/stroeerCoreBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ export const spec = {
};
}

const ORTB2_KEYS = ['regs.ext.dsa', 'device.ext.cdep'];
const ORTB2_KEYS = ['regs.ext.dsa', 'device.ext.cdep', 'source.tid'];
ORTB2_KEYS.forEach(key => {
const value = utils.deepAccess(bidderRequest.ortb2, key);
if (value !== undefined) {
Expand Down Expand Up @@ -266,7 +266,8 @@ export const spec = {
viz: elementInView(metaTagPosition),
ctx: getContextFromSDG(metaTagPosition),
kvl: getLocalKeyValues(metaTagPosition),
sfp: bidRequest.params.sfp
sfp: bidRequest.params.sfp,
tid: bidRequest.transactionId,
};

return Object.assign(bid, customAttrsFn(bidRequest));
Expand Down
35 changes: 35 additions & 0 deletions test/spec/modules/stroeerCoreBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1182,6 +1182,22 @@ describe('stroeerCore bid adapter', function() {
assert.deepNestedPropertyVal(bid, 'ban.fp.siz', [{ w: 160, h: 60, p: 2.7 }]);
});

it('should add the bid transaction id', () => {
const bidReq = buildBidderRequest();
const uuid0 = "f9545c4c-7d3f-4941-9319-d515af162085";
const uuid1 = "8ce92d85-e9b0-4682-8025-bf58d452b2a7";

bidReq.bids[0].transactionId = uuid0;
bidReq.bids[1].transactionId = uuid1;

const serverRequestInfo = spec.buildRequests(bidReq.bids, bidReq)[0];

const [bid0, bid1] = serverRequestInfo.data.bids;

assert.equal(bid0.tid, uuid0);
assert.equal(bid1.tid, uuid1);
});

describe('ortb2 interface', () => {
it('should add all user data if available', () => {
const bidReq = buildBidderRequest();
Expand Down Expand Up @@ -1275,6 +1291,25 @@ describe('stroeerCore bid adapter', function() {

assert.deepEqual(sentOrtb2, ortb2);
});

it('should add the source transaction id', () => {
const bidReq = buildBidderRequest();
const tid = "7c3c82b2-30bb-49dc-9e3b-0148cd769a28";

const ortb2 = {
source: {
tid
}
};

bidReq.ortb2 = utils.deepClone(ortb2);

const serverRequestInfo = spec.buildRequests(bidReq.bids, bidReq)[0];

const sentOrtb2 = serverRequestInfo.data.ortb2;

assert.equal(sentOrtb2.source.tid, tid);
});
});
});

Expand Down

0 comments on commit a99e1ee

Please sign in to comment.