Skip to content

Commit

Permalink
ZetaGlobalSsp Analytics Adapter : provide adUnitCode (prebid#11812)
Browse files Browse the repository at this point in the history
  • Loading branch information
orazumov-zeta authored Jun 17, 2024
1 parent eedcb05 commit 8e1d5a7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
12 changes: 8 additions & 4 deletions modules/zeta_global_sspAnalyticsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ function adRenderSucceededHandler(args) {
size: args.bid?.size,
adomain: args.bid?.adserverTargeting?.hb_adomain,
timeToRespond: args.bid?.timeToRespond,
cpm: args.bid?.cpm
cpm: args.bid?.cpm,
adUnitCode: args.bid?.adUnitCode
},
device: {
ua: navigator.userAgent
Expand All @@ -63,7 +64,8 @@ function auctionEndHandler(args) {
bidder: b?.bidder,
mediaType: b?.mediaTypes?.video ? 'VIDEO' : (b?.mediaTypes?.banner ? 'BANNER' : undefined),
size: b?.sizes?.filter(s => s && s.length === 2).filter(s => Number.isInteger(s[0]) && Number.isInteger(s[1])).map(s => s[0] + 'x' + s[1]).find(s => s),
device: b?.ortb2?.device
device: b?.ortb2?.device,
adUnitCode: b?.adUnitCode
}))
})),
bidsReceived: args.bidsReceived?.map(br => ({
Expand All @@ -75,7 +77,8 @@ function auctionEndHandler(args) {
size: br?.size,
adomain: br?.adserverTargeting?.hb_adomain,
timeToRespond: br?.timeToRespond,
cpm: br?.cpm
cpm: br?.cpm,
adUnitCode: br?.adUnitCode
}))
}
sendEvent(EVENTS.AUCTION_END, event);
Expand All @@ -93,7 +96,8 @@ function bidTimeoutHandler(args) {
mediaType: t?.mediaTypes?.video ? 'VIDEO' : (t?.mediaTypes?.banner ? 'BANNER' : undefined),
size: t?.sizes?.filter(s => s && s.length === 2).filter(s => Number.isInteger(s[0]) && Number.isInteger(s[1])).map(s => s[0] + 'x' + s[1]).find(s => s),
timeout: t?.timeout,
device: t?.ortb2?.device
device: t?.ortb2?.device,
adUnitCode: t?.adUnitCode
}))
}
sendEvent(EVENTS.BID_TIMEOUT, event);
Expand Down
4 changes: 4 additions & 0 deletions test/spec/modules/zeta_global_sspAnalyticsAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ describe('Zeta Global SSP Analytics Adapter', function () {
domain: 'test-zeta-ssp.net:63342',
page: 'http://test-zeta-ssp.net:63342/zeta-ssp/ssp/_dev/examples/page_banner.html',
bids: [{
adUnitCode: '/19968336/header-bid-tag-0',
bidId: '206be9a13236af',
auctionId: '75e394d9',
bidder: 'zeta_global_ssp',
Expand All @@ -426,6 +427,7 @@ describe('Zeta Global SSP Analytics Adapter', function () {
domain: 'test-zeta-ssp.net:63342',
page: 'http://test-zeta-ssp.net:63342/zeta-ssp/ssp/_dev/examples/page_banner.html',
bids: [{
adUnitCode: '/19968336/header-bid-tag-0',
bidId: '41badc0e164c758',
auctionId: '75e394d9',
bidder: 'appnexus',
Expand All @@ -437,6 +439,7 @@ describe('Zeta Global SSP Analytics Adapter', function () {
}]
}],
bidsReceived: [{
adUnitCode: '/19968336/header-bid-tag-0',
adId: '5759bb3ef7be1e8',
requestId: '206be9a13236af',
creativeId: '456456456',
Expand All @@ -459,6 +462,7 @@ describe('Zeta Global SSP Analytics Adapter', function () {
expect(auctionSucceeded.domain).to.eql('test-zeta-ssp.net');
expect(auctionSucceeded.page).to.eql('test-zeta-ssp.net/zeta-ssp/ssp/_dev/examples/page_banner.html');
expect(auctionSucceeded.bid).to.be.deep.equal({
adUnitCode: '/19968336/header-bid-tag-0',
adId: '5759bb3ef7be1e8',
requestId: '206be9a13236af',
auctionId: '75e394d9',
Expand Down

0 comments on commit 8e1d5a7

Please sign in to comment.