Skip to content

Commit

Permalink
GumGum Bid Adapter : Id5 integration suppress link type for ttd (preb…
Browse files Browse the repository at this point in the history
…id#9924)

* ADJS-1271-send-envelope-param-for-lexicon

* Read the id5 id linktype field and send it to the server.

* Remove unit test for Id5

* Add unit test for id5.

* minor changes to possibly fix edge error

---------

Co-authored-by: John Bauzon <john.bauzon@gumgum.com>
Co-authored-by: John Ivan Bauzon <johnbauzon@gmail.com>
  • Loading branch information
3 people authored and Michele Nasti committed Aug 25, 2023
1 parent ae62fe4 commit 4cfe585
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/gumgumBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,11 @@ function buildRequests(validBidRequests, bidderRequest) {
data.lt = lt;
data.to = to;

// ADJS-1286 Read id5 id linktype field
if (userId && userId.id5id && userId.id5id.uid && userId.id5id.ext) {
data.id5Id = userId.id5id.uid || null
data.id5IdLinkType = userId.id5id.ext.linkType || null
}
// ADTS-169 add adUnitCode to requests
if (adUnitCode) data.aun = adUnitCode;

Expand Down
14 changes: 14 additions & 0 deletions test/spec/modules/gumgumBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,14 @@ describe('gumgumAdapter', function () {
sizes: sizesArray
}
},
userId: {
id5id: {
uid: 'uid-string',
ext: {
linkType: 2
}
}
},
adUnitCode: 'adunit-code',
sizes: sizesArray,
bidId: '30b31c1838de1e',
Expand Down Expand Up @@ -158,6 +166,12 @@ describe('gumgumAdapter', function () {
const bidRequest = spec.buildRequests([request])[0];
expect(bidRequest.data.aun).to.equal(bidRequests[0].adUnitCode);
});
it('should set id5Id and id5IdLinkType if the uid and linkType are available', function () {
const request = { ...bidRequests[0] };
const bidRequest = spec.buildRequests([request])[0];
expect(bidRequest.data.id5Id).to.equal(bidRequests[0].userId.id5id.uid);
expect(bidRequest.data.id5IdLinkType).to.equal(bidRequests[0].userId.id5id.ext.linkType);
});

it('should set pubId param if found', function () {
const request = { ...bidRequests[0], params: pubIdParam };
Expand Down

0 comments on commit 4cfe585

Please sign in to comment.