From 8e1d5a72c575f9674302b671924c4eecefc2be70 Mon Sep 17 00:00:00 2001 From: orazumov-zeta <99964372+orazumov-zeta@users.noreply.github.com> Date: Mon, 17 Jun 2024 15:29:57 +0300 Subject: [PATCH] ZetaGlobalSsp Analytics Adapter : provide adUnitCode (#11812) --- modules/zeta_global_sspAnalyticsAdapter.js | 12 ++++++++---- .../modules/zeta_global_sspAnalyticsAdapter_spec.js | 4 ++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/modules/zeta_global_sspAnalyticsAdapter.js b/modules/zeta_global_sspAnalyticsAdapter.js index 31bcffcd7b1..02cfb8739b7 100644 --- a/modules/zeta_global_sspAnalyticsAdapter.js +++ b/modules/zeta_global_sspAnalyticsAdapter.js @@ -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 @@ -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 => ({ @@ -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); @@ -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); diff --git a/test/spec/modules/zeta_global_sspAnalyticsAdapter_spec.js b/test/spec/modules/zeta_global_sspAnalyticsAdapter_spec.js index 4331060b1cd..7abfc7dcc10 100644 --- a/test/spec/modules/zeta_global_sspAnalyticsAdapter_spec.js +++ b/test/spec/modules/zeta_global_sspAnalyticsAdapter_spec.js @@ -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', @@ -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', @@ -437,6 +439,7 @@ describe('Zeta Global SSP Analytics Adapter', function () { }] }], bidsReceived: [{ + adUnitCode: '/19968336/header-bid-tag-0', adId: '5759bb3ef7be1e8', requestId: '206be9a13236af', creativeId: '456456456', @@ -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',