Skip to content

Commit 7f0732f

Browse files
authored
BeOp Bid Adapter: add eids support (prebid#11025)
* BeOp Bid Adapter: Add eids support (#14) * Fix tests
1 parent 0ad3244 commit 7f0732f

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

modules/beopBidAdapter.js

+2
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ export const spec = {
7272
is_amp: deepAccess(bidderRequest, 'referrerInfo.isAmp'),
7373
gdpr_applies: gdpr ? gdpr.gdprApplies : false,
7474
tc_string: (gdpr && gdpr.gdprApplies) ? gdpr.consentString : null,
75+
eids: firstSlot.eids,
7576
};
7677

7778
const payloadString = JSON.stringify(payloadObject);
@@ -159,6 +160,7 @@ function beOpRequestSlotsMaker(bid) {
159160
brc: getBidIdParameter('bidRequestsCount', bid),
160161
bdrc: getBidIdParameter('bidderRequestCount', bid),
161162
bwc: getBidIdParameter('bidderWinsCount', bid),
163+
eids: bid.userIdAsEids,
162164
}
163165
}
164166

test/spec/modules/beopBidAdapter_spec.js

+18
Original file line numberDiff line numberDiff line change
@@ -312,4 +312,22 @@ describe('BeOp Bid Adapter tests', () => {
312312
expect(payload.kwds).to.include('keywords');
313313
})
314314
})
315+
316+
describe('Ensure eids are get', function() {
317+
let bidRequests = [];
318+
afterEach(function () {
319+
bidRequests = [];
320+
});
321+
322+
it(`should get eids from bid`, function () {
323+
let bid = Object.assign({}, validBid);
324+
bid.userIdAsEids = [{source: 'provider.com', uids: [{id: 'someid', atype: 1, ext: {whatever: true}}]}];
325+
bidRequests.push(bid);
326+
327+
const request = spec.buildRequests(bidRequests, {});
328+
const payload = JSON.parse(request.data);
329+
expect(payload.eids).to.exist;
330+
expect(payload.eids[0].source).to.equal('provider.com');
331+
});
332+
})
315333
});

0 commit comments

Comments
 (0)