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

ZetaGlobalSsp Analytics : fix array.find bug #12306

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
da0b4a5
Merge pull request #1 from prebid/master
asurovenko-zeta Mar 24, 2021
f4ec68e
Merge branch 'master' of git://github.com/prebid/Prebid.js
surovenko Apr 21, 2021
01990a9
Merge remote-tracking branch 'upstream/master'
surovenko May 18, 2021
62f969f
Merge remote-tracking branch 'upstream/master'
surovenko May 18, 2021
ec7c8f0
Merge remote-tracking branch 'upstream/master'
surovenko May 19, 2021
89fe5b1
Merge remote-tracking branch 'upstream/master'
surovenko May 24, 2021
6dc0255
Merge remote-tracking branch 'upstream/master'
surovenko Jun 1, 2021
8dc9ac2
Merge remote-tracking branch 'upstream/master'
surovenko Jun 3, 2021
35353f0
Merge remote-tracking branch 'upstream/master'
surovenko Jun 3, 2021
e6f982a
Merge remote-tracking branch 'upstream/master'
surovenko Jun 4, 2021
70e546c
Merge remote-tracking branch 'upstream/master'
surovenko Jun 7, 2021
cc56875
Merge remote-tracking branch 'upstream/master'
surovenko Jun 15, 2021
f4f2a1e
Merge remote-tracking branch 'upstream/master'
surovenko Jun 16, 2021
3f96c6a
Merge remote-tracking branch 'upstream/master'
surovenko Jul 8, 2021
8e503cd
Merge remote-tracking branch 'upstream/master'
surovenko Aug 3, 2021
1781bfd
Merge remote-tracking branch 'upstream/master'
surovenko Aug 12, 2021
459917b
Merge remote-tracking branch 'upstream/master'
surovenko Aug 17, 2021
9ce50bd
Merge remote-tracking branch 'upstream/master'
surovenko Aug 18, 2021
8f7f147
Merge remote-tracking branch 'upstream/master'
surovenko Aug 19, 2021
a280757
Merge remote-tracking branch 'upstream/master'
surovenko Sep 22, 2021
036d5f1
Merge remote-tracking branch 'upstream/master'
surovenko Nov 19, 2021
33e883f
Merge remote-tracking branch 'upstream/master'
surovenko Nov 26, 2021
e729eb9
Merge remote-tracking branch 'upstream/master'
surovenko Dec 28, 2021
c202e93
Merge remote-tracking branch 'origin/master'
surovenko Feb 17, 2022
95877a7
Merge remote-tracking branch 'upstream/master'
surovenko Feb 22, 2022
bf8f638
Merge remote-tracking branch 'upstream/master'
surovenko Feb 28, 2022
461374f
Merge remote-tracking branch 'upstream/master'
surovenko Mar 5, 2022
b6a2fdc
Merge remote-tracking branch 'upstream/master'
surovenko Mar 9, 2022
92b44e3
Merge remote-tracking branch 'upstream/master'
surovenko May 23, 2022
42381eb
Merge remote-tracking branch 'upstream/master'
surovenko May 25, 2022
f629f34
Merge remote-tracking branch 'upstream/master'
surovenko May 26, 2022
9627d5d
Merge remote-tracking branch 'upstream/master'
surovenko May 27, 2022
3d0c2b2
Merge remote-tracking branch 'upstream/master'
surovenko Aug 10, 2022
0dfdb1c
Merge remote-tracking branch 'upstream/master'
surovenko Nov 14, 2022
9438a2e
Merge remote-tracking branch 'upstream/master'
Feb 1, 2023
4198c51
Merge remote-tracking branch 'upstream/master'
asurovenko-zeta Feb 15, 2023
4064f1f
Merge remote-tracking branch 'upstream/master'
asurovenko-zeta Mar 16, 2023
6b380a1
Merge remote-tracking branch 'upstream/master'
asurovenko-zeta Apr 5, 2023
6cd4e3f
Merge remote-tracking branch 'upstream/master'
asurovenko-zeta Apr 25, 2023
1794ae1
Merge remote-tracking branch 'upstream/master'
asurovenko-zeta Jun 2, 2023
42d2317
Merge remote-tracking branch 'upstream/master'
asurovenko-zeta Jun 8, 2023
691c896
Merge remote-tracking branch 'upstream/master'
asurovenko-zeta Aug 28, 2023
e3a97f6
Merge remote-tracking branch 'upstream/master'
asurovenko-zeta Sep 20, 2023
3669809
Merge remote-tracking branch 'upstream/master'
asurovenko-zeta Sep 29, 2023
312817c
-
asurovenko-zeta Nov 7, 2023
050688f
Merge remote-tracking branch 'upstream/master'
asurovenko-zeta Dec 6, 2023
efe75b0
Merge remote-tracking branch 'origin/master'
asurovenko-zeta Dec 29, 2023
37ba030
1
asurovenko-zeta Feb 3, 2024
169c80e
Merge remote-tracking branch 'upstream/master'
asurovenko-zeta Feb 5, 2024
681914e
Merge remote-tracking branch 'upstream/master'
asurovenko-zeta Feb 12, 2024
14d4d1e
-
asurovenko-zeta Feb 18, 2024
b142183
Merge remote-tracking branch 'upstream/master'
asurovenko-zeta Feb 28, 2024
fd465b6
Merge remote-tracking branch 'upstream/master'
asurovenko-zeta Feb 28, 2024
e2ba2ed
Merge remote-tracking branch 'origin/master'
asurovenko-zeta Mar 12, 2024
fe06e5b
ZetaGlobalSsp Adapter: crop page
asurovenko-zeta Mar 18, 2024
c4bdc83
Merge remote-tracking branch 'origin/master'
asurovenko-zeta May 9, 2024
7db9c11
Merge remote-tracking branch 'origin/master'
asurovenko-zeta May 20, 2024
dee944c
Merge remote-tracking branch 'origin/master'
asurovenko-zeta May 29, 2024
1b9662e
Merge remote-tracking branch 'origin/master'
asurovenko-zeta Jun 12, 2024
a2b2943
Merge remote-tracking branch 'origin/master'
asurovenko-zeta Jun 14, 2024
cf52bbd
Merge remote-tracking branch 'origin/master'
asurovenko-zeta Oct 9, 2024
0c6b57b
ZetaGlobalSspAnalytics Adapter: bugfix
asurovenko-zeta Oct 9, 2024
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: 2 additions & 2 deletions modules/zeta_global_sspAnalyticsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ function auctionEndHandler(args) {
function bidTimeoutHandler(args) {
const event = {
zetaParams: zetaParams,
domain: args.find(t => t?.ortb2?.site?.domain),
page: args.find(t => t?.ortb2?.site?.page),
domain: args.find(t => t?.ortb2?.site?.domain)?.ortb2?.site?.domain,
page: args.find(t => t?.ortb2?.site?.page)?.ortb2?.site?.page,
timeouts: args.map(t => ({
bidId: t?.bidId,
auctionId: t?.auctionId,
Expand Down
229 changes: 227 additions & 2 deletions test/spec/modules/zeta_global_sspAnalyticsAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,171 @@ const SAMPLE_EVENTS = {
]
},
'adId': '5759bb3ef7be1e8'
}
},
BID_TIMEOUT: [
{
'bidder': 'zeta_global_ssp',
'params': [
{
'tags': {
'position': 'top',
'shortname': 'someShortName',
},
'sid': 100
}
],
'mediaTypes': {
'banner': {
'sizes': [
[
300,
250
]
]
}
},
'adUnitCode': 'ad-1',
'transactionId': '6d2c4757-d34b-4538-b812-c6e638f05eac',
'adUnitId': '9dc8cbf6-9b2d-48c7-b424-be9ae4be3dfc',
'sizes': [
[
300,
250
]
],
'bidId': '27c8c05823e2f',
'bidderRequestId': '1e8e895de1708',
'auctionId': 'fa9ef841-bcb9-401f-96ad-03a94ac64e63',
'bidRequestsCount': 1,
'bidderRequestsCount': 1,
'bidderWinsCount': 0,
'ortb2': {
'site': {
'domain': 'zetaglobal.com',
'publisher': {
'domain': 'zetaglobal.com'
},
'page': 'https://zetaglobal.com/page'
},
'device': {
'w': 807,
'h': 847,
'dnt': 0,
'ua': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36',
'language': 'en',
'sua': {
'source': 1,
'platform': {
'brand': 'macOS'
},
'browsers': [
{
'brand': 'Google Chrome',
'version': [
'123'
]
},
{
'brand': 'Not:A-Brand',
'version': [
'8'
]
},
{
'brand': 'Chromium',
'version': [
'123'
]
}
],
'mobile': 0
}
}
},
'timeout': 3
},
{
'bidder': 'zeta_global_ssp',
'params': [
{
'tags': {
'position': 'top',
'shortname': 'someShortName',
},
'sid': 100
}
],
'mediaTypes': {
'banner': {
'sizes': [
[
300,
250
]
]
}
},
'adUnitCode': 'ad-2',
'transactionId': '11eaa59f-221d-4027-a0a8-7841e0ffc4ee',
'adUnitId': '4397b4bc-6368-40b8-91f1-987a31076886',
'sizes': [
[
300,
250
]
],
'bidId': '31a3b551cbf1ed',
'bidderRequestId': '1e8e895de1708',
'auctionId': 'fa9ef841-bcb9-401f-96ad-03a94ac64e63',
'bidRequestsCount': 1,
'bidderRequestsCount': 1,
'bidderWinsCount': 0,
'ortb2': {
'site': {
'domain': 'zetaglobal.com',
'publisher': {
'domain': 'zetaglobal.com'
},
'page': 'https://zetaglobal.com/page'
},
'device': {
'w': 807,
'h': 847,
'dnt': 0,
'ua': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36',
'language': 'en',
'sua': {
'source': 1,
'platform': {
'brand': 'macOS'
},
'browsers': [
{
'brand': 'Google Chrome',
'version': [
'123'
]
},
{
'brand': 'Not:A-Brand',
'version': [
'8'
]
},
{
'brand': 'Chromium',
'version': [
'123'
]
}
],
'mobile': 0
}
}
},
'timeout': 3
}
]
}

describe('Zeta Global SSP Analytics Adapter', function () {
Expand Down Expand Up @@ -402,8 +566,9 @@ describe('Zeta Global SSP Analytics Adapter', function () {

events.emit(EVENTS.AUCTION_END, SAMPLE_EVENTS.AUCTION_END);
events.emit(EVENTS.AD_RENDER_SUCCEEDED, SAMPLE_EVENTS.AD_RENDER_SUCCEEDED);
events.emit(EVENTS.BID_TIMEOUT, SAMPLE_EVENTS.BID_TIMEOUT);

expect(requests.length).to.equal(2);
expect(requests.length).to.equal(3);
const auctionEnd = JSON.parse(requests[0].requestBody);
expect(auctionEnd).to.be.deep.equal({
zetaParams: {sid: 111, tags: {position: 'top', shortname: 'name'}},
Expand Down Expand Up @@ -475,6 +640,66 @@ describe('Zeta Global SSP Analytics Adapter', function () {
cpm: 2.258302852806723
});
expect(auctionSucceeded.device.ua).to.not.be.empty;

const bidTimeout = JSON.parse(requests[2].requestBody);
expect(bidTimeout.zetaParams).to.be.deep.equal({
sid: 111,
tags: {
position: 'top',
shortname: 'name'
}
});
expect(bidTimeout.domain).to.eql('zetaglobal.com');
expect(bidTimeout.page).to.eql('https://zetaglobal.com/page');
expect(bidTimeout.timeouts).to.be.deep.equal([{
'bidId': '27c8c05823e2f',
'auctionId': 'fa9ef841-bcb9-401f-96ad-03a94ac64e63',
'bidder': 'zeta_global_ssp',
'mediaType': 'BANNER',
'size': '300x250',
'timeout': 3,
'device': {
'w': 807,
'h': 847,
'dnt': 0,
'ua': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36',
'language': 'en',
'sua': {
'source': 1,
'platform': {'brand': 'macOS'},
'browsers': [{'brand': 'Google Chrome', 'version': ['123']}, {
'brand': 'Not:A-Brand',
'version': ['8']
}, {'brand': 'Chromium', 'version': ['123']}],
'mobile': 0
}
},
'adUnitCode': 'ad-1'
}, {
'bidId': '31a3b551cbf1ed',
'auctionId': 'fa9ef841-bcb9-401f-96ad-03a94ac64e63',
'bidder': 'zeta_global_ssp',
'mediaType': 'BANNER',
'size': '300x250',
'timeout': 3,
'device': {
'w': 807,
'h': 847,
'dnt': 0,
'ua': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36',
'language': 'en',
'sua': {
'source': 1,
'platform': {'brand': 'macOS'},
'browsers': [{'brand': 'Google Chrome', 'version': ['123']}, {
'brand': 'Not:A-Brand',
'version': ['8']
}, {'brand': 'Chromium', 'version': ['123']}],
'mobile': 0
}
},
'adUnitCode': 'ad-2'
}]);
});
});
});