Skip to content

Commit

Permalink
adWMG Adapter: add 'adomain' support (prebid#6852)
Browse files Browse the repository at this point in the history
* Support floorCPM parameter, fix some minor bugs

* fix space-in-parens circleci error

* example fix

* clean usersync URL

* spaces

* spaces

* add new unit tests, compatibility with IE11

* remove logInfo

* Check for floorCPM value

* Check params before sending

* New endpoints

* code format

* new endpoint for cookie sync

* update tests

* Add meta.advertiserDomains data support

* Add meta.advertiserDomains data support

Co-authored-by: Mikhail Dykun <[email protected]>
  • Loading branch information
2 people authored and stsepelin committed May 28, 2021
1 parent 20adaa4 commit 6c79f9a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions modules/adWMGBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ export const spec = {
netRevenue: response.netRevenue,
ttl: response.ttl,
ad: response.ad,
meta: {
advertiserDomains: response.adomain && response.adomain.length ? response.adomain : [],
mediaType: 'banner'
}
};
bidResponses.push(bidResponse);
}
Expand Down
7 changes: 5 additions & 2 deletions test/spec/modules/adWMGBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ describe('adWMGBidAdapter', function () {
'ttl': 300,
'creativeId': 'creative-id',
'netRevenue': true,
'currency': 'USD'
'currency': 'USD',
'adomain': ['testdomain.com']
}
};
});
Expand All @@ -219,7 +220,7 @@ describe('adWMGBidAdapter', function () {
expect(responses).to.be.an('array').that.is.not.empty;

let response = responses[0];
expect(response).to.have.all.keys('requestId', 'cpm', 'width', 'height', 'ad', 'ttl', 'creativeId',
expect(response).to.have.all.keys('requestId', 'cpm', 'width', 'height', 'meta', 'ad', 'ttl', 'creativeId',
'netRevenue', 'currency');
expect(response.requestId).to.equal('request-id');
expect(response.cpm).to.equal(100);
Expand All @@ -230,6 +231,8 @@ describe('adWMGBidAdapter', function () {
expect(response.creativeId).to.equal('creative-id');
expect(response.netRevenue).to.be.true;
expect(response.currency).to.equal('USD');
expect(response.meta.advertiserDomains[0]).to.equal('testdomain.com');
expect(response.meta.mediaType).to.equal('banner');
});

it('should return an empty array when serverResponse is empty', () => {
Expand Down

0 comments on commit 6c79f9a

Please sign in to comment.