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: extended app/site parameters on win notice #9765

Merged
merged 28 commits into from
Apr 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
c55d01a
AIDEM Bid Adapter
gsollazzo Nov 9, 2022
c4b2f0d
Merge branch 'prebid:master' into master
gsollazzo Nov 9, 2022
6a443d2
Merge branch 'prebid:master' into master
gsollazzo Nov 10, 2022
fc359c1
Added _spec.js
gsollazzo Nov 10, 2022
61c803e
update
gsollazzo Nov 11, 2022
b36e93f
Merge branch 'prebid:master' into master
gsollazzo Nov 11, 2022
3c36ef2
Fix Navigator in _spec.js
gsollazzo Nov 14, 2022
4222cca
Merge branch 'prebid:master' into master
gsollazzo Nov 15, 2022
502397e
Removed timeout handler.
Nov 16, 2022
a87853d
Merge branch 'prebid:master' into master
gsollazzo Nov 16, 2022
9277d1e
Added publisherId as required bidder params
Nov 18, 2022
a42e2cf
Merge remote-tracking branch 'origin/master'
Nov 18, 2022
31d6b22
moved publisherId into site publisher object
Nov 18, 2022
705f255
Added wpar to environment
gsollazzo Dec 26, 2022
c2e0dee
Merge remote-tracking branch 'upstream/master'
gsollazzo Dec 26, 2022
ace8d4a
Merge branch 'prebid:master' into master
gsollazzo Dec 28, 2022
3a319ee
Added placementId parameter
gsollazzo Dec 28, 2022
48e57f2
Merge branch 'prebid:master' into master
gsollazzo Dec 28, 2022
9e804e5
Merge branch 'prebid:master' into master
darkstarac Jan 2, 2023
f704255
added unit tests for the wpar environment object
Jan 2, 2023
b99b274
Merge branch 'prebid:master' into master
gsollazzo Jan 3, 2023
5cf7879
Merge branch 'prebid:master' into master
darkstarac Jan 24, 2023
f077631
PlacementId is now a required parameter
Jan 24, 2023
6837c05
Merge branch 'prebid:master' into master
darkstarac Jan 30, 2023
4d67382
Revert to optional placementId parameter
Jan 30, 2023
8a68d01
Merge remote-tracking branch 'origin/master'
Jan 30, 2023
edc505f
Merge branch 'prebid:master' into master
darkstarac Apr 5, 2023
c0b91a2
Extended win notice
Apr 5, 2023
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
5 changes: 5 additions & 0 deletions modules/aidemBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ function getPageUrl(bidderRequest) {

function buildWinNotice(bid) {
const params = bid.params[0];
const app = deepAccess(bid, 'meta.ext.app')
return {
publisherId: params.publisherId,
siteId: params.siteId,
Expand All @@ -167,6 +168,9 @@ function buildWinNotice(bid) {
ttl: bid.ttl,
requestTimestamp: bid.requestTimestamp,
responseTimestamp: bid.responseTimestamp,
mediatype: bid.mediaType,
environment: app ? 'app' : 'web',
...app
};
}

Expand Down Expand Up @@ -348,6 +352,7 @@ function getPrebidResponseBidObject(openRTBResponseBidObject) {
function setPrebidResponseBidObjectMeta(prebidResponseBidObject, openRTBResponseBidObject) {
logInfo('AIDEM Bid Adapter meta', openRTBResponseBidObject);
deepSetValue(prebidResponseBidObject, 'meta.advertiserDomains', deepAccess(openRTBResponseBidObject, 'meta.advertiserDomains'));
deepSetValue(prebidResponseBidObject, 'meta.ext', deepAccess(openRTBResponseBidObject, 'meta.ext'));
if (openRTBResponseBidObject.cat && Array.isArray(openRTBResponseBidObject.cat)) {
const primaryCatId = openRTBResponseBidObject.cat.shift();
deepSetValue(prebidResponseBidObject, 'meta.primaryCatId', primaryCatId);
Expand Down
80 changes: 72 additions & 8 deletions test/spec/modules/aidemBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ const SERVER_RESPONSE_VIDEO = {
},
}

const WIN_NOTICE = {
const WIN_NOTICE_WEB = {
'adId': '3a20ee5dc78c1e',
'adUnitCode': 'div-gpt-ad-1460505748561-0',
'creativeId': '24277955',
Expand All @@ -297,9 +297,71 @@ const WIN_NOTICE = {
'USD'
],
'mediaType': 'banner',
'advertiserDomains': [
'abc.com'
'meta': {
'advertiserDomains': [
'cloudflare.com'
],
'ext': {}
},
'size': '300x250',
'params': [
{
'placementId': '13144370',
'siteId': '23434',
'publisherId': '7689670753'
}
],
'width': 300,
'height': 250,
'status': 'rendered',
'transactionId': 'ce089116-4251-45c3-bdbb-3a03cb13816b',
'ttl': 300,
'requestTimestamp': 1666796241007,
'responseTimestamp': 1666796241021,
metrics: {
getMetrics() {
return {

}
}
}
}

const WIN_NOTICE_APP = {
'adId': '3a20ee5dc78c1e',
'adUnitCode': 'div-gpt-ad-1460505748561-0',
'creativeId': '24277955',
'cpm': 1,
'netRevenue': false,
'adserverTargeting': {
'hb_bidder': 'aidem',
'hb_adid': '3a20ee5dc78c1e',
'hb_pb': '1.00',
'hb_size': '300x250',
'hb_source': 'client',
'hb_format': 'banner',
'hb_adomain': 'example.com'
},

'auctionId': '85864730-6cbc-4e56-bc3c-a4a6596dca5b',
'currency': [
'USD'
],
'mediaType': 'banner',
'meta': {
'advertiserDomains': [
'cloudflare.com'
],
'ext': {
'app': {
'app_bundle': '{{APP_BUNDLE}}',
'app_id': '{{APP_ID}}',
'app_name': '{{APP_NAME}}',
'app_store_url': '{{APP_STORE_URL}}',
'inventory_source': '{{INVENTORY_SOURCE}}'
}
}
},
'size': '300x250',
'params': [
{
Expand Down Expand Up @@ -549,11 +611,13 @@ describe('Aidem adapter', () => {
expect(spec.onBidWon).to.exist.and.to.be.a('function')
});

it(`should send a valid bid won notice`, function () {
spec.onBidWon(WIN_NOTICE);
// server.respondWith('POST', WIN_EVENT_URL, [
// 400, {'Content-Type': 'application/json'}, )
// ]);
it(`should send a valid bid won notice from web environment`, function () {
spec.onBidWon(WIN_NOTICE_WEB);
expect(server.requests.length).to.equal(1);
});

it(`should send a valid bid won notice from app environment`, function () {
spec.onBidWon(WIN_NOTICE_APP);
expect(server.requests.length).to.equal(1);
});
});
Expand Down