Skip to content

Commit

Permalink
Trion bid adapter: support for meta advertiserDomains (#6829)
Browse files Browse the repository at this point in the history
* Adding files associated with the trion adapter update to the newest prebid version(1.0).

* Updating pull request with safer checks for user sync and general clean up/consistency of tests.

* removing a call to bidder code for pull request review.  also removing the test that requires it

* there were some changes to the bid factory after our initial release that we didn't account for.  Changing adapter to account for response body and required params.

* Revert "there were some changes to the bid factory after our initial release that we didn't account for.  Changing adapter to account for response body and required params."

This reverts commit 324d157.

* there were some changes to the bid factory after our initial release that we didn't account for.  Changing adapter to account for response body and required params.

* adding safety checks to Trion adapter

* Sending up to trion endpoint if there is bot traffic or the browser tab is not visible.

* sending the wrong param in the test.

* Trion test cleanup.  returning document and window states to their original form after tests.

* Trion test cleanup.  using before and after to alter window and document objects in tests.

* re-adding trion adapter to prebid project to stop using deprecated function for page url for 3.0 release

* minor formatting change

* accept size array from media types banner over the sizes array from pubs.

* updating trion bid adapter to be us privacy and gdpr compliant

* encoding consent strings for test

* Trion adapter update.  Changing request params to trion including removing support for optional 're' param, cleaning up existing params to send 1/0 instead of null when non is present and adding prebid version.

* adding support for meta advertiserDomains in trion bid adapter for future use

Co-authored-by: Mike Groh <mgroh@trioninteractive.com>
  • Loading branch information
grohm33 and Mike Groh authored May 26, 2021
1 parent 6580bf4 commit cc68ad4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions modules/trionBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ export const spec = {
bid.creativeId = result.creativeId;
bid.currency = result.currency;
bid.netRevenue = result.netRevenue;
if (result.adomain) {
bid.meta = {advertiserDomains: result.adomain}
}
bidResponses.push(bid);
}
}
Expand Down
9 changes: 9 additions & 0 deletions test/spec/modules/trionBidAdapter_spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {expect} from 'chai';
import * as utils from 'src/utils.js';
import {spec, acceptPostMessage, getStorageData, setStorageData} from 'modules/trionBidAdapter.js';
import {deepClone} from 'src/utils.js';

const CONSTANTS = require('src/constants.json');
const adloader = require('src/adloader');
Expand Down Expand Up @@ -316,6 +317,14 @@ describe('Trion adapter tests', function () {
expect(response[0].cpm).to.equal(bidCpm);
TRION_BID_RESPONSE.result.cpm = 100;
});

it('advertiserDomains is included when sent by server', function () {
TRION_BID_RESPONSE.result.adomain = ['test_adomain'];
let response = spec.interpretResponse({body: TRION_BID_RESPONSE}, {bidRequest: TRION_BID});
expect(Object.keys(response[0].meta)).to.include.members(['advertiserDomains']);
expect(response[0].meta.advertiserDomains).to.deep.equal(['test_adomain']);
delete TRION_BID_RESPONSE.result.adomain;
});
});

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

0 comments on commit cc68ad4

Please sign in to comment.