Skip to content

Commit

Permalink
Vidazoo Bid Adapter: pass sua params. (#9636)
Browse files Browse the repository at this point in the history
* feat(module): multi size request

* fix getUserSyncs
added tests

* update(module): package-lock.json from master

* feat(module): VidazooBidAdapter - send top query params to server

* feat: pass sua params to bid request.

---------

Co-authored-by: Udi Talias <udi.talias@gmail.com>
Co-authored-by: roman <shmoop207@gmail.com>
  • Loading branch information
3 people committed Mar 8, 2023
1 parent 130efeb commit 69ec909
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 1 deletion.
8 changes: 7 additions & 1 deletion modules/vidazooBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {registerBidder} from '../src/adapters/bidderFactory.js';
import {BANNER, VIDEO} from '../src/mediaTypes.js';
import {getStorageManager} from '../src/storageManager.js';
import {bidderSettings} from '../src/bidderSettings.js';
import { config } from '../src/config.js';
import {config} from '../src/config.js';

const GVLID = 744;
const DEFAULT_SUB_DOMAIN = 'prebid';
Expand Down Expand Up @@ -138,6 +138,12 @@ function buildRequest(bid, topWindowUrl, sizes, bidderRequest, bidderTimeout) {

appendUserIdsToRequestPayload(data, userId);

const sua = deepAccess(bidderRequest, 'ortb2.device.sua');

if (sua) {
data.sua = sua;
}

if (bidderRequest.gdprConsent) {
if (bidderRequest.gdprConsent.consentString) {
data.gdprConsent = bidderRequest.gdprConsent.consentString;
Expand Down
50 changes: 50 additions & 0 deletions test/spec/modules/vidazooBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,24 @@ const BIDDER_REQUEST = {
'regs': {
'gpp': 'gpp_string',
'gpp_sid': [7]
},
'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': ''
}
}
},
};
Expand Down Expand Up @@ -281,6 +299,22 @@ describe('VidazooBidAdapter', function () {
schain: VIDEO_BID.schain,
sessionId: '',
sizes: ['545x307'],
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': ''
},
uniqueDealId: `${hashUrl}_${Date.now().toString()}`,
uqs: getTopWindowQueryParams(),
isStorageAllowed: true,
Expand Down Expand Up @@ -330,6 +364,22 @@ describe('VidazooBidAdapter', function () {
transactionId: 'c881914b-a3b5-4ecf-ad9c-1c2f37c6aabf',
bidderRequestId: '1fdb5ff1b6eaa7',
sizes: ['300x250', '300x600'],
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': ''
},
url: 'https%3A%2F%2Fwww.greatsite.com',
referrer: 'https://www.somereferrer.com',
cb: 1000,
Expand Down

0 comments on commit 69ec909

Please sign in to comment.