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

TL-18499: Add advertiserDomains support #11

Merged
1 commit merged into from
Nov 17, 2020
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
4 changes: 4 additions & 0 deletions modules/tripleliftBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,10 @@ function _buildResponseObject(bidderRequest, bid) {
if (bid.advertiser_name) {
bidResponse.meta.advertiserName = bid.advertiser_name;
}

if (bid.adomain && bid.adomain.length) {
bidResponse.meta.advertiserDomains = bid.adomain;
Copy link
Author

Choose a reason for hiding this comment

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

@kzhouTL is this assignment correct? I don't have to do any map function? Just want to make sure there is not a weird copy by reference/value nuance I'm missing

}
};
return bidResponse;
}
Expand Down
10 changes: 9 additions & 1 deletion test/spec/modules/tripleliftBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,8 @@ describe('triplelift adapter', function () {
ad: 'ad-markup',
iurl: 'https://s.adroll.com/a/IYR/N36/IYRN366MFVDITBAGNNT5U6.jpg',
tl_source: 'tlx',
advertiser_name: 'fake advertiser name'
advertiser_name: 'fake advertiser name',
adomain: ['basspro.com', 'internetalerts.org']
},
{
imp_id: 1,
Expand Down Expand Up @@ -747,6 +748,13 @@ describe('triplelift adapter', function () {
expect(result[0].meta.advertiserName).to.equal('fake advertiser name');
expect(result[1].meta).to.not.have.key('advertiserName');
});

it('should include the advertiser domain array in the meta field if available', function () {
let result = tripleliftAdapterSpec.interpretResponse(response, {bidderRequest});
expect(result[0].meta.advertiserDomains[0]).to.equal('basspro.com');
expect(result[0].meta.advertiserDomains[1]).to.equal('internetalerts.org');
expect(result[1].meta).to.not.have.key('advertiserDomains');
});
});

describe('getUserSyncs', function() {
Expand Down