Skip to content

Commit

Permalink
Vidazoo Bid Adapter: allow all id systems (#9910)
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: allow all id systems to pass.

---------

Co-authored-by: Udi Talias <udi.talias@gmail.com>
Co-authored-by: roman <shmoop207@gmail.com>
  • Loading branch information
3 people authored May 9, 2023
1 parent ca2f974 commit fbfb4c7
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 34 deletions.
60 changes: 28 additions & 32 deletions modules/vidazooBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,6 @@ const DEAL_ID_EXPIRY = 1000 * 60 * 15;
const UNIQUE_DEAL_ID_EXPIRY = 1000 * 60 * 60;
const SESSION_ID_KEY = 'vidSid';
const OPT_CACHE_KEY = 'vdzwopt';
export const SUPPORTED_ID_SYSTEMS = {
'britepoolid': 1,
'criteoId': 1,
'id5id': 1,
'idl_env': 1,
'lipb': 1,
'netId': 1,
'parrableId': 1,
'pubcid': 1,
'tdid': 1,
'pubProvidedId': 1
};
export const webSessionId = 'wsid_' + parseInt(Date.now() * Math.random());
const storage = getStorageManager({bidderCode: BIDDER_CODE});

Expand Down Expand Up @@ -180,25 +168,22 @@ function buildRequest(bid, topWindowUrl, sizes, bidderRequest, bidderTimeout) {
function appendUserIdsToRequestPayload(payloadRef, userIds) {
let key;
_each(userIds, (userId, idSystemProviderName) => {
if (SUPPORTED_ID_SYSTEMS[idSystemProviderName]) {
key = `uid.${idSystemProviderName}`;

switch (idSystemProviderName) {
case 'digitrustid':
payloadRef[key] = deepAccess(userId, 'data.id');
break;
case 'lipb':
payloadRef[key] = userId.lipbid;
break;
case 'parrableId':
payloadRef[key] = userId.eid;
break;
case 'id5id':
payloadRef[key] = userId.uid;
break;
default:
payloadRef[key] = userId;
}
key = `uid.${idSystemProviderName}`;
switch (idSystemProviderName) {
case 'digitrustid':
payloadRef[key] = deepAccess(userId, 'data.id');
break;
case 'lipb':
payloadRef[key] = userId.lipbid;
break;
case 'parrableId':
payloadRef[key] = userId.eid;
break;
case 'id5id':
payloadRef[key] = userId.uid;
break;
default:
payloadRef[key] = userId;
}
});
}
Expand Down Expand Up @@ -227,7 +212,18 @@ function interpretResponse(serverResponse, request) {

try {
results.forEach(result => {
const {creativeId, ad, price, exp, width, height, currency, advertiserDomains, metaData, mediaType = BANNER} = result;
const {
creativeId,
ad,
price,
exp,
width,
height,
currency,
advertiserDomains,
metaData,
mediaType = BANNER
} = result;
if (!ad || !price) {
return;
}
Expand Down
5 changes: 3 additions & 2 deletions test/spec/modules/vidazooBidAdapter_spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {expect} from 'chai';
import {
spec as adapter,
SUPPORTED_ID_SYSTEMS,
createDomain,
hashCode,
extractPID,
Expand All @@ -21,6 +20,8 @@ import {useFakeTimers} from 'sinon';
import {BANNER, VIDEO} from '../../../src/mediaTypes';
import {config} from '../../../src/config';

export const TEST_ID_SYSTEMS = ['britepoolid', 'criteoId', 'id5id', 'idl_env', 'lipb', 'netId', 'parrableId', 'pubcid', 'tdid', 'pubProvidedId'];

const SUB_DOMAIN = 'openrtb';

const BID = {
Expand Down Expand Up @@ -520,7 +521,7 @@ describe('VidazooBidAdapter', function () {
});

describe('user id system', function () {
Object.keys(SUPPORTED_ID_SYSTEMS).forEach((idSystemProvider) => {
TEST_ID_SYSTEMS.forEach((idSystemProvider) => {
const id = Date.now().toString();
const bid = utils.deepClone(BID);

Expand Down

0 comments on commit fbfb4c7

Please sign in to comment.