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

AIDEM Bid Adapter: added wpar and placementId param #9377

Merged
merged 21 commits into from
Jan 3, 2023
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/aidemBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ function setPrebidImpressionObject(bidRequests, payload) {
deepSetValue(impressionObject, 'id', bidRequest.bidId);
// Transaction id
deepSetValue(impressionObject, 'tid', deepAccess(bidRequest, 'transactionId'));
// Placement id
deepSetValue(impressionObject, 'tagid', deepAccess(bidRequest, 'params.placementId', null));
// Publisher id
deepSetValue(payload, 'site.publisher.id', deepAccess(bidRequest, 'params.publisherId'));
// Site id
Expand Down Expand Up @@ -265,6 +267,8 @@ function setPrebidRequestEnvironment(payload) {
deepSetValue(payload, 'environment.inp.jp', window.JSON.parse.name === 'parse' && typeof window.JSON.parse.prototype === 'undefined');
deepSetValue(payload, 'environment.inp.ofe', window.Object.fromEntries.name === 'fromEntries' && typeof window.Object.fromEntries.prototype === 'undefined');
deepSetValue(payload, 'environment.inp.oa', window.Object.assign.name === 'assign' && typeof window.Object.assign.prototype === 'undefined');
deepSetValue(payload, 'environment.wpar.innerWidth', window.innerWidth);
deepSetValue(payload, 'environment.wpar.innerHeight', window.innerHeight);
gsollazzo marked this conversation as resolved.
Show resolved Hide resolved
}

function setPrebidImpressionObjectFloor(bidRequest, impressionObject) {
Expand Down
1 change: 1 addition & 0 deletions modules/aidemBidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ This module is GDPR and CCPA compliant, and no 3rd party userIds are allowed.
|---------------|----------|---------------------|---------------|----------|
| `siteId` | required | Unique site ID | `'ABCDEF'` | `String` |
| `publisherId` | required | Unique publisher ID | `'ABCDEF'` | `String` |
| `placementId` | optional | Unique publisher tag ID | `'ABCDEF'` | `String` |


### Banner Bid Params
Expand Down
12 changes: 10 additions & 2 deletions test/spec/modules/aidemBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ describe('Aidem adapter', () => {
expect(payload.imp).to.be.a('array').that.has.lengthOf(DEFAULT_VALID_BANNER_REQUESTS.length)

expect(payload.imp[0]).to.be.a('object').that.has.all.keys(
'banner', 'id', 'mediatype', 'imp_ext', 'tid'
'banner', 'id', 'mediatype', 'imp_ext', 'tid', 'tagid'
)
expect(payload.imp[0].banner).to.be.a('object').that.has.all.keys(
'format', 'topframe'
Expand All @@ -401,7 +401,7 @@ describe('Aidem adapter', () => {
expect(payload.imp).to.be.a('array').that.has.lengthOf(DEFAULT_VALID_VIDEO_REQUESTS.length)

expect(payload.imp[0]).to.be.a('object').that.has.all.keys(
'video', 'id', 'mediatype', 'imp_ext', 'tid'
'video', 'id', 'mediatype', 'imp_ext', 'tid', 'tagid'
)
expect(payload.imp[0].video).to.be.a('object').that.has.all.keys(
'format', 'mimes', 'minDuration', 'maxDuration', 'protocols'
Expand All @@ -421,6 +421,14 @@ describe('Aidem adapter', () => {
'value', 'currency'
)
});

it('should hav wpar keys in environment object', function () {
const requests = spec.buildRequests(DEFAULT_VALID_VIDEO_REQUESTS, VALID_BIDDER_REQUEST);
const payload = JSON.parse(requests.data)
expect(payload).to.have.property('environment')
expect(payload.environment).to.be.a('object').that.have.property('wpar')
expect(payload.environment.wpar).to.be.a('object').that.has.keys('innerWidth', 'innerHeight')
});
})

describe('interpretResponse', () => {
Expand Down