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

Smartx Bid Adapter: Add meta.advertiserDomains support #6547

Merged
merged 22 commits into from
Apr 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
aa0c2de
Add smartclipBidAdapter
May 20, 2020
a4daadc
smartxBidAdapter.js - removed unused variables, removed debug, added …
Skylinar Sep 2, 2020
d87968f
Merge branch 'master' of https://github.com/smartclip-adtech/Prebid.js
Oct 14, 2020
41fb65e
Merge branch 'master' of https://github.com/prebid/Prebid.js
Oct 14, 2020
a34fc49
Merge branch 'master' of https://github.com/prebid/Prebid.js
Oct 27, 2020
f5481d7
Merge branch 'master' of https://github.com/prebid/Prebid.js
Nov 4, 2020
1510b28
Merge commit 'b7ec359ca242ceab4cd0c7e37307247974126e51'
smartclip-adtech Jan 28, 2021
2a965c9
- made outstream player configurable
Skylinar Jan 29, 2021
b577bd3
remove wrong named files
Skylinar Jan 29, 2021
2b96ef1
camelcase
Skylinar Jan 29, 2021
8715820
fix
Skylinar Feb 3, 2021
b55fb7d
Out-Stream render update to SmartPlay 5.2
Skylinar Mar 1, 2021
41ba404
Merge branch 'master' of https://github.com/prebid/Prebid.js
Skylinar Mar 1, 2021
1af62e6
ESlint fix
Skylinar Mar 1, 2021
1ef8d74
ESlint fix
Skylinar Mar 1, 2021
9134944
ESlint fix
Skylinar Mar 1, 2021
335b9bd
adjust tests, fixes
Skylinar Mar 5, 2021
1ae18d1
ESlint
Skylinar Mar 5, 2021
f6d4816
adjusted desired bitrate examples
Skylinar Mar 18, 2021
ed40876
Merge branch 'master' of https://github.com/prebid/Prebid.js
Skylinar Mar 18, 2021
94b7510
added bid.meta.advertiserDomains support
Skylinar Apr 8, 2021
fc86b71
Merge branch 'master' of https://github.com/prebid/Prebid.js
Skylinar Apr 8, 2021
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
13 changes: 13 additions & 0 deletions modules/smartxBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ export const spec = {
}

const language = navigator.language ? 'language' : 'userLanguage';

const device = {
h: screen.height,
w: screen.width,
Expand All @@ -157,8 +158,11 @@ export const spec = {
make: navigator.vendor ? navigator.vendor : '',
ua: navigator.userAgent
};

const at = utils.getBidIdParameter('at', bid.params) || 2;

const cur = utils.getBidIdParameter('cur', bid.params) || ['EUR'];

const requestPayload = {
id: utils.generateUUID(),
imp: smartxReq,
Expand All @@ -176,6 +180,7 @@ export const spec = {
at: at,
cur: cur
};

const userExt = {};

// Add GDPR flag and consent string
Expand Down Expand Up @@ -271,6 +276,7 @@ export const spec = {
serverResponseBody.cur = pmb.currency;
}
});

const bid = {
requestId: currentBidRequest.bidId,
currency: serverResponseBody.cur || 'USD',
Expand All @@ -284,7 +290,14 @@ export const spec = {
width: smartxBid.w,
height: smartxBid.h
};

bid.meta = bid.meta || {};
if (smartxBid && smartxBid.adomain && smartxBid.adomain.length > 0) {
bid.meta.advertiserDomains = smartxBid.adomain;
}

const context = utils.deepAccess(currentBidRequest, 'mediaTypes.video.context');

if (context === 'outstream') {
const playersize = utils.deepAccess(currentBidRequest, 'mediaTypes.video.playerSize');
const renderer = Renderer.install({
Expand Down
2 changes: 2 additions & 0 deletions test/spec/modules/smartxBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ describe('The smartx adapter', function () {
expect(responses).to.be.an('array').with.length(2);
expect(bidderRequestObj).to.be.an('Object');
expect(bidderRequestObj.bidRequest.bids).to.be.an('array').with.length(2);
expect(responses[0].meta.advertiserDomains[0]).to.equal('abc.com');
expect(responses[0].requestId).to.equal(123);
expect(responses[0].currency).to.equal('USD');
expect(responses[0].cpm).to.equal(12);
Expand All @@ -432,6 +433,7 @@ describe('The smartx adapter', function () {
expect(responses[0].mediaType).to.equal('video');
expect(responses[0].width).to.equal(400);
expect(responses[0].height).to.equal(300);
expect(responses[1].meta.advertiserDomains[0]).to.equal('def.com');
expect(responses[1].requestId).to.equal(124);
expect(responses[1].currency).to.equal('USD');
expect(responses[1].cpm).to.equal(13);
Expand Down