Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vidoomy Adapter: Added userId module #9795

Merged
merged 1 commit into from
Apr 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions modules/vidoomyBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ const buildRequests = (validBidRequests, bidderRequest) => {
const bidfloor = deepAccess(bid, `params.bidfloor`, 0);
const floor = getBidFloor(bid, adType, sizes, bidfloor);

let eids;
const userEids = deepAccess(bid, 'userIdAsEids');
if (Array.isArray(userEids) && userEids.length > 0) {
eids = JSON.stringify(userEids) || '';
}

const queryParams = {
id: bid.params.id,
adtype: adType,
Expand All @@ -141,6 +147,7 @@ const buildRequests = (validBidRequests, bidderRequest) => {
pid: bid.params.pid,
requestId: bid.bidId,
schain: serializeSupplyChainObj(bid.schain) || '',
eids: eids || '',
bidfloor: floor,
d: getDomainWithoutSubdomain(hostname), // 'vidoomy.com',
// TODO: does the fallback make sense here?
Expand Down
23 changes: 23 additions & 0 deletions test/spec/modules/vidoomyBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,29 @@ describe('vidoomyBidAdapter', function() {
expect(request[0].data.schain).to.eq(serializedForm);
});

it('should return standard json formated eids', function () {
const eids = [{
source: 'pubcid.org',
uids: [
{
id: 'some-random-id-value-1',
atype: 1
}
]
},
{
source: 'adserver.org',
uids: [{
id: 'some-random-id-value-2',
atype: 1
}]
}]
bidRequests[0].userIdAsEids = eids
const bidRequest = spec.buildRequests(bidRequests, bidderRequest);
expect(bidRequest[0].data).to.include.any.keys('eids');
expect(JSON.parse(bidRequest[0].data.eids)).to.eql(eids);
});

it('should set the bidfloor if getFloor module is undefined but static bidfloor is present', function () {
const request = { ...bidRequests[0], params: { bidfloor: 2.5 } }
const req = spec.buildRequests([request], bidderRequest)[0];
Expand Down