Skip to content

Commit

Permalink
BeOp Bid Adapter: Add eids support (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebrobert authored Jan 31, 2024
1 parent 2171ca4 commit ef89495
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/beopBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export const spec = {
is_amp: deepAccess(bidderRequest, 'referrerInfo.isAmp'),
gdpr_applies: gdpr ? gdpr.gdprApplies : false,
tc_string: (gdpr && gdpr.gdprApplies) ? gdpr.consentString : null,
eids: firstSlot.eids,
};

const payloadString = JSON.stringify(payloadObject);
Expand Down Expand Up @@ -159,6 +160,7 @@ function beOpRequestSlotsMaker(bid) {
brc: getBidIdParameter('bidRequestsCount', bid),
bdrc: getBidIdParameter('bidderRequestCount', bid),
bwc: getBidIdParameter('bidderWinsCount', bid),
eids: bid.userIdAsEids,
}
}

Expand Down
18 changes: 18 additions & 0 deletions test/spec/modules/beopBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,4 +312,22 @@ describe('BeOp Bid Adapter tests', () => {
expect(payload.kwds).to.include('keywords');
})
})

describe('Ensure eids are get', function() {
let bidRequests = [];
afterEach(function () {
bidRequests = [];
});

it(`should get eids from bid`, function () {
let bid = Object.assign({}, validBid);
bid.userIdAsEids = [{source: 'provider.com', uids: [{id: 'someid',atype: 1, ext: {whatever:true}}]}];
bidRequests.push(validBid);

const request = spec.buildRequests(bidRequests, {});
const payload = JSON.parse(request.data);
expect(payload.eids).to.exist;
expect(payload.eids[0].source).to.equal('provider.com');
});
})
});

0 comments on commit ef89495

Please sign in to comment.