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

Freewheel SSP Bid Adapter : support userIdAsEids #9655

Merged
merged 6 commits into from
Mar 14, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
Freewheel-SSP-Adapter add test for eids
  • Loading branch information
xwang202 committed Mar 13, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit ace764c44a4d6c375999d0837a200cf0d08f7edd
2 changes: 1 addition & 1 deletion modules/freewheel-sspBidAdapter.js
Original file line number Diff line number Diff line change
@@ -381,7 +381,7 @@ export const spec = {
}
}

if (currentBidRequest.userId && currentBidRequest.userIdAsEids) {
if (currentBidRequest.userIdAsEids && currentBidRequest.userIdAsEids.length > 0) {
try {
requestParams._fw_prebid_3p_UID = JSON.stringify(currentBidRequest.userIdAsEids);
} catch (error) {
17 changes: 17 additions & 0 deletions test/spec/modules/freewheel-sspBidAdapter_spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { expect } from 'chai';
import { spec } from 'modules/freewheel-sspBidAdapter.js';
import { newBidder } from 'src/adapters/bidderFactory.js';
import { createEidsArray } from 'modules/userId/eids.js';

const ENDPOINT = '//ads.stickyadstv.com/www/delivery/swfIndex.php';

@@ -131,6 +132,22 @@ describe('freewheelSSP BidAdapter Test', () => {
expect(payload._fw_bidfloorcur).to.deep.equal('USD');
});

it('should pass 3rd party IDs with the request when present', function () {
const bidRequest = bidRequests[0];
bidRequest.userIdAsEids = createEidsArray({
tdid: 'TTD_ID_FROM_USER_ID_MODULE',
admixerId: 'admixerId_FROM_USER_ID_MODULE',
adtelligentId: 'adtelligentId_FROM_USER_ID_MODULE'
});
const request = spec.buildRequests(bidRequests);
const payload = request[0].data;
expect(payload._fw_prebid_3p_UID).to.deep.equal(JSON.stringify([
{source: 'adserver.org', uids: [{id: 'TTD_ID_FROM_USER_ID_MODULE', atype: 1, ext: {rtiPartner: 'TDID'}}]},
{source: 'admixer.net', uids: [{id: 'admixerId_FROM_USER_ID_MODULE', atype: 3}]},
{source: 'adtelligent.com', uids: [{id: 'adtelligentId_FROM_USER_ID_MODULE', atype: 3}]},
]));
});

it('should return empty bidFloorCurrency when bidfloor <= 0', () => {
const bidRequest = bidRequests[0];
bidRequest.getFloor = () => ({ currency: 'USD', floor: -1 });