Skip to content

Commit

Permalink
Vidazoo bid adapter add ortb2 device (#12640)
Browse files Browse the repository at this point in the history
* Vidazoo Bid Adapter: Add ORTB2 device data to request payload

* Vidazoo Bid Adapter: Update exco adapter tests to include ORTB2 device

---------

Co-authored-by: Bohdan V <[email protected]>
  • Loading branch information
jwrosewell and BohdanVV authored Jan 10, 2025
1 parent fab7207 commit 7a210da
Show file tree
Hide file tree
Showing 8 changed files with 235 additions and 126 deletions.
2 changes: 2 additions & 0 deletions libraries/vidazooUtils/bidderUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ export function buildRequestData(bid, topWindowUrl, sizes, bidderRequest, bidder
const userData = deepAccess(bidderRequest, 'ortb2.user.data', []);
const contentLang = deepAccess(bidderRequest, 'ortb2.site.content.language') || document.documentElement.lang;
const coppa = deepAccess(bidderRequest, 'ortb2.regs.coppa', 0);
const device = deepAccess(bidderRequest, 'ortb2.device', {});

if (isFn(bid.getFloor)) {
const floorInfo = bid.getFloor({
Expand Down Expand Up @@ -290,6 +291,7 @@ export function buildRequestData(bid, topWindowUrl, sizes, bidderRequest, bidder
bidderRequestsCount: bidderRequestsCount,
bidderWinsCount: bidderWinsCount,
bidderTimeout: bidderTimeout,
device,
...uniqueRequestData
};

Expand Down
51 changes: 33 additions & 18 deletions test/spec/modules/excoBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,36 @@ const VIDEO_BID = {
}
}

const ORTB2_DEVICE = {
sua: {
'source': 2,
'platform': {
'brand': 'Android',
'version': ['8', '0', '0']
},
'browsers': [
{'brand': 'Not_A Brand', 'version': ['99', '0', '0', '0']},
{'brand': 'Google Chrome', 'version': ['109', '0', '5414', '119']},
{'brand': 'Chromium', 'version': ['109', '0', '5414', '119']}
],
'mobile': 1,
'model': 'SM-G955U',
'bitness': '64',
'architecture': ''
},
w: 980,
h: 1720,
dnt: 0,
ua: 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/125.0.6422.80 Mobile/15E148 Safari/604.1',
language: 'en',
devicetype: 1,
make: 'Apple',
model: 'iPhone 12 Pro Max',
os: 'iOS',
osv: '17.4',
ext: {fiftyonedegrees_deviceId: '17595-133085-133468-18092'},
};

const BIDDER_REQUEST = {
'gdprConsent': {
'consentString': 'consent_string',
Expand All @@ -117,24 +147,7 @@ const BIDDER_REQUEST = {
'gpp_sid': [7],
'coppa': 0
},
'device': {
'sua': {
'source': 2,
'platform': {
'brand': 'Android',
'version': ['8', '0', '0']
},
'browsers': [
{'brand': 'Not_A Brand', 'version': ['99', '0', '0', '0']},
{'brand': 'Google Chrome', 'version': ['109', '0', '5414', '119']},
{'brand': 'Chromium', 'version': ['109', '0', '5414', '119']}
],
'mobile': 1,
'model': 'SM-G955U',
'bitness': '64',
'architecture': ''
}
}
'device': ORTB2_DEVICE,
}
};

Expand Down Expand Up @@ -315,6 +328,7 @@ describe('ExcoBidAdapter', function () {
'bitness': '64',
'architecture': ''
},
device: ORTB2_DEVICE,
uniqueDealId: `${hashUrl}_${Date.now().toString()}`,
uqs: getTopWindowQueryParams(),
mediaTypes: {
Expand Down Expand Up @@ -386,6 +400,7 @@ describe('ExcoBidAdapter', function () {
'bitness': '64',
'architecture': ''
},
device: ORTB2_DEVICE,
url: 'https%3A%2F%2Fwww.greatsite.com',
referrer: 'https://www.somereferrer.com',
cb: 1000,
Expand Down
51 changes: 33 additions & 18 deletions test/spec/modules/illuminBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,36 @@ const VIDEO_BID = {
}
}

const ORTB2_DEVICE = {
sua: {
'source': 2,
'platform': {
'brand': 'Android',
'version': ['8', '0', '0']
},
'browsers': [
{'brand': 'Not_A Brand', 'version': ['99', '0', '0', '0']},
{'brand': 'Google Chrome', 'version': ['109', '0', '5414', '119']},
{'brand': 'Chromium', 'version': ['109', '0', '5414', '119']}
],
'mobile': 1,
'model': 'SM-G955U',
'bitness': '64',
'architecture': ''
},
w: 980,
h: 1720,
dnt: 0,
ua: 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/125.0.6422.80 Mobile/15E148 Safari/604.1',
language: 'en',
devicetype: 1,
make: 'Apple',
model: 'iPhone 12 Pro Max',
os: 'iOS',
osv: '17.4',
ext: {fiftyonedegrees_deviceId: '17595-133085-133468-18092'},
};

const BIDDER_REQUEST = {
'gdprConsent': {
'consentString': 'consent_string',
Expand All @@ -117,24 +147,7 @@ const BIDDER_REQUEST = {
'gpp_sid': [7],
'coppa': 0
},
'device': {
'sua': {
'source': 2,
'platform': {
'brand': 'Android',
'version': ['8', '0', '0']
},
'browsers': [
{'brand': 'Not_A Brand', 'version': ['99', '0', '0', '0']},
{'brand': 'Google Chrome', 'version': ['109', '0', '5414', '119']},
{'brand': 'Chromium', 'version': ['109', '0', '5414', '119']}
],
'mobile': 1,
'model': 'SM-G955U',
'bitness': '64',
'architecture': ''
}
}
'device': ORTB2_DEVICE,
}
};

Expand Down Expand Up @@ -315,6 +328,7 @@ describe('IlluminBidAdapter', function () {
'bitness': '64',
'architecture': ''
},
device: ORTB2_DEVICE,
uniqueDealId: `${hashUrl}_${Date.now().toString()}`,
uqs: getTopWindowQueryParams(),
mediaTypes: {
Expand Down Expand Up @@ -386,6 +400,7 @@ describe('IlluminBidAdapter', function () {
'bitness': '64',
'architecture': ''
},
device: ORTB2_DEVICE,
url: 'https%3A%2F%2Fwww.greatsite.com',
referrer: 'https://www.somereferrer.com',
cb: 1000,
Expand Down
51 changes: 33 additions & 18 deletions test/spec/modules/kueezRtbBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,36 @@ const VIDEO_BID = {
}
}

const ORTB2_DEVICE = {
sua: {
'source': 2,
'platform': {
'brand': 'Android',
'version': ['8', '0', '0']
},
'browsers': [
{'brand': 'Not_A Brand', 'version': ['99', '0', '0', '0']},
{'brand': 'Google Chrome', 'version': ['109', '0', '5414', '119']},
{'brand': 'Chromium', 'version': ['109', '0', '5414', '119']}
],
'mobile': 1,
'model': 'SM-G955U',
'bitness': '64',
'architecture': ''
},
w: 980,
h: 1720,
dnt: 0,
ua: 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/125.0.6422.80 Mobile/15E148 Safari/604.1',
language: 'en',
devicetype: 1,
make: 'Apple',
model: 'iPhone 12 Pro Max',
os: 'iOS',
osv: '17.4',
ext: {fiftyonedegrees_deviceId: '17595-133085-133468-18092'},
};

const BIDDER_REQUEST = {
'gdprConsent': {
'consentString': 'consent_string',
Expand All @@ -116,24 +146,7 @@ const BIDDER_REQUEST = {
'gpp_sid': [7],
'coppa': 0
},
'device': {
'sua': {
'source': 2,
'platform': {
'brand': 'Android',
'version': ['8', '0', '0']
},
'browsers': [
{'brand': 'Not_A Brand', 'version': ['99', '0', '0', '0']},
{'brand': 'Google Chrome', 'version': ['109', '0', '5414', '119']},
{'brand': 'Chromium', 'version': ['109', '0', '5414', '119']}
],
'mobile': 1,
'model': 'SM-G955U',
'bitness': '64',
'architecture': ''
}
}
'device': ORTB2_DEVICE,
}
};

Expand Down Expand Up @@ -321,6 +334,7 @@ describe('KueezRtbBidAdapter', function () {
'bitness': '64',
'architecture': ''
},
device: ORTB2_DEVICE,
uniqueDealId: `${hashUrl}_${Date.now().toString()}`,
uqs: getTopWindowQueryParams(),
mediaTypes: {
Expand Down Expand Up @@ -394,6 +408,7 @@ describe('KueezRtbBidAdapter', function () {
'bitness': '64',
'architecture': ''
},
device: ORTB2_DEVICE,
url: 'https%3A%2F%2Fwww.greatsite.com',
referrer: 'https://www.somereferrer.com',
cb: 1000,
Expand Down
51 changes: 33 additions & 18 deletions test/spec/modules/shinezRtbBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,36 @@ const VIDEO_BID = {
}
}

const ORTB2_DEVICE = {
sua: {
'source': 2,
'platform': {
'brand': 'Android',
'version': ['8', '0', '0']
},
'browsers': [
{'brand': 'Not_A Brand', 'version': ['99', '0', '0', '0']},
{'brand': 'Google Chrome', 'version': ['109', '0', '5414', '119']},
{'brand': 'Chromium', 'version': ['109', '0', '5414', '119']}
],
'mobile': 1,
'model': 'SM-G955U',
'bitness': '64',
'architecture': ''
},
w: 980,
h: 1720,
dnt: 0,
ua: 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/125.0.6422.80 Mobile/15E148 Safari/604.1',
language: 'en',
devicetype: 1,
make: 'Apple',
model: 'iPhone 12 Pro Max',
os: 'iOS',
osv: '17.4',
ext: {fiftyonedegrees_deviceId: '17595-133085-133468-18092'},
};

const BIDDER_REQUEST = {
'gdprConsent': {
'consentString': 'consent_string',
Expand All @@ -119,24 +149,7 @@ const BIDDER_REQUEST = {
'gpp_sid': [7],
'coppa': 0
},
'device': {
'sua': {
'source': 2,
'platform': {
'brand': 'Android',
'version': ['8', '0', '0']
},
'browsers': [
{'brand': 'Not_A Brand', 'version': ['99', '0', '0', '0']},
{'brand': 'Google Chrome', 'version': ['109', '0', '5414', '119']},
{'brand': 'Chromium', 'version': ['109', '0', '5414', '119']}
],
'mobile': 1,
'model': 'SM-G955U',
'bitness': '64',
'architecture': ''
}
}
'device': ORTB2_DEVICE,
}
};

Expand Down Expand Up @@ -317,6 +330,7 @@ describe('ShinezRtbBidAdapter', function () {
'bitness': '64',
'architecture': ''
},
device: ORTB2_DEVICE,
uniqueDealId: `${hashUrl}_${Date.now().toString()}`,
uqs: getTopWindowQueryParams(),
mediaTypes: {
Expand Down Expand Up @@ -388,6 +402,7 @@ describe('ShinezRtbBidAdapter', function () {
'bitness': '64',
'architecture': ''
},
device: ORTB2_DEVICE,
url: 'https%3A%2F%2Fwww.greatsite.com',
referrer: 'https://www.somereferrer.com',
cb: 1000,
Expand Down
Loading

0 comments on commit 7a210da

Please sign in to comment.