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

added tdid and ad-unit-code #23

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
3f6c9be
added tdid and ad-unit-code
Jun 16, 2020
06ed63b
fixed tdid
Jun 16, 2020
27654f1
merged master
Jun 17, 2020
5ac08c6
PubMatic bid adapter to support price floors module (#5387)
pm-harshad-mane Jun 18, 2020
9b4def5
Triplelift Adaptor: Use Floors Module (#5329)
colbertk Jun 18, 2020
7421370
removed digitrust
Jun 18, 2020
a394bc6
appnexusBidAdapter - fix video params (#5394)
jsnellbaker Jun 19, 2020
aa877b2
PubMatic adds support for bidUserIdAsEids (#5397)
pm-harshad-mane Jun 19, 2020
cab6058
repush
jrosendahl Jun 19, 2020
4e59331
External ids (#5351)
lowendavid Jun 22, 2020
57f8beb
33Across: CCPA Compliance + Schain support (#5365)
curlyblueeagle Jun 22, 2020
ba6d904
added waardex adapter (#5349)
mshuhaliia Jun 22, 2020
cc845b0
Add customParams to yieldlab configuration (#5374)
mirkorean Jun 22, 2020
263c6cc
Vidazoo Adapter: Feature/user-id (#5386)
uditalias Jun 23, 2020
d9d7c0c
LiveIntentId submodule updates (#5407)
jankoulaga Jun 23, 2020
18d1e10
33Across: Adding floors support (#5408)
curlyblueeagle Jun 23, 2020
9c47806
Vidazoo Adapter: Feature/screen-size (#5385)
uditalias Jun 23, 2020
6cfe4cc
Appier: add support for aliases (#5392)
justinkuo-appier Jun 23, 2020
3857643
Add GMOSSP Adapter (#5377)
arasaki-yuki Jun 24, 2020
cf33ada
add package-lock from upstream master
jrosendahl Jun 24, 2020
ca2f896
Delete package-lock.json
jrosendahl Jun 24, 2020
72a4d7a
add package-lock from upstream master
jrosendahl Jun 24, 2020
09a92ba
Merge remote-tracking branch 'upstream/master' into SNEK-320-TDID
jrosendahl Jun 24, 2020
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
23 changes: 21 additions & 2 deletions modules/sovrnBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const spec = {
let iv;
let schain;
let digitrust;
let unifiedID;

utils._each(bidReqs, function (bid) {
if (!digitrust) {
Expand All @@ -38,6 +39,10 @@ export const spec = {
}
}
}
if (!unifiedID) {
unifiedID = utils.deepAccess(bid, 'userId.tdid');
}

if (bid.schain) {
schain = schain || bid.schain;
}
Expand All @@ -48,6 +53,7 @@ export const spec = {
bidSizes = bidSizes.filter(size => utils.isArray(size))
const processedSizes = bidSizes.map(size => ({w: parseInt(size[0], 10), h: parseInt(size[1], 10)}))
sovrnImps.push({
adunitcode: bid.adUnitCode,
id: bid.bidId,
banner: {
format: processedSizes,
Expand Down Expand Up @@ -95,9 +101,22 @@ export const spec = {
keyv: digitrust.keyv
})
}
if (unifiedID) {
const idArray = [{
source: 'adserver.org',
uids: [
{
id: unifiedID,
ext: {
rtiPartner: 'TIDI'
}
}
]
}]
utils.deepSetValue(sovrnBidReq, 'user.ext.eids', idArray)
}

let url = `https://ap.lijit.com/rtb/bid?` +
`src=$$REPO_AND_VERSION$$`;
let url = `https://ap.lijit.com/rtb/bid?src=$$REPO_AND_VERSION$$`;
if (iv) url += `&iv=${iv}`;

return {
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 35 additions & 2 deletions test/spec/modules/sovrnBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,17 @@ describe('sovrnBidAdapter', function() {
});

it('sets the proper banner object', function() {
const payload = JSON.parse(request.data);
const payload = JSON.parse(request.data)
expect(payload.imp[0].banner.format).to.deep.equal([{w: 300, h: 250}, {w: 300, h: 600}])
expect(payload.imp[0].banner.w).to.equal(1)
expect(payload.imp[0].banner.h).to.equal(1)
})

it('includes the ad unit code int the request', function() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

const payload = JSON.parse(request.data);
expect(payload.imp[0].adunitcode).to.equal('adunit-code')
})

it('accepts a single array as a size', function() {
const singleSize = [{
'bidder': 'sovrn',
Expand Down Expand Up @@ -267,8 +272,36 @@ describe('sovrnBidAdapter', function() {
expect(data.user.ext.digitrust.id).to.equal('digitrust-id-123');
expect(data.user.ext.digitrust.keyv).to.equal(4);
});
});
it('should add the unifiedID if present', function() {
const digitrustRequests = [{
'bidder': 'sovrn',
'params': {
'tagid': 403370
},
'adUnitCode': 'adunit-code',
'sizes': [
[300, 250],
[300, 600]
],
'bidId': '30b31c1838de1e',
'bidderRequestId': '22edbae2733bf6',
'auctionId': '1d1a030790a475',
'userId': {
'tdid': 'SOMESORTOFID',
}
}].concat(bidRequests);
const bidderRequest = {
refererInfo: {
referer: 'http://example.com/page.html',
}
};

const data = JSON.parse(spec.buildRequests(digitrustRequests, bidderRequest).data);
expect(data.user.ext.eids[0].source).to.equal('adserver.org')
expect(data.user.ext.eids[0].uids[0].id).to.equal('SOMESORTOFID')
expect(data.user.ext.eids[0].uids[0].ext.rtiPartner).to.equal('TIDI')
})
});
describe('interpretResponse', function () {
let response;
beforeEach(function () {
Expand Down