Skip to content

Commit

Permalink
Merge branch 'prebid:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
jsadwith authored Mar 2, 2022
2 parents a8af96a + 688d0b9 commit 780e3c7
Show file tree
Hide file tree
Showing 85 changed files with 746 additions and 363 deletions.
2 changes: 1 addition & 1 deletion modules/adagioBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const SUPPORTED_MEDIA_TYPES = [BANNER, NATIVE, VIDEO];
const ADAGIO_TAG_URL = 'https://script.4dex.io/localstore.js';
const ADAGIO_LOCALSTORAGE_KEY = 'adagioScript';
const GVLID = 617;
export const storage = getStorageManager(GVLID, 'adagio');
export const storage = getStorageManager({gvlid: GVLID, bidderCode: BIDDER_CODE});
export const RENDERER_URL = 'https://script.4dex.io/outstream-player.js';
const MAX_SESS_DURATION = 30 * 60 * 1000;
const ADAGIO_PUBKEY = 'AL16XT44Sfp+8SHVF1UdC7hydPSMVLMhsYknKDdwqq+0ToDSJrP0+Qh0ki9JJI2uYm/6VEYo8TJED9WfMkiJ4vf02CW3RvSWwc35bif2SK1L8Nn/GfFYr/2/GG/Rm0vUsv+vBHky6nuuYls20Og0HDhMgaOlXoQ/cxMuiy5QSktp';
Expand Down
2 changes: 1 addition & 1 deletion modules/adbookpspBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ function bannerHasSingleSize(bidRequest) {
* USER SYNC
*/

export const storage = getStorageManager();
export const storage = getStorageManager({bidderCode: BIDDER_CODE});

function getUserSyncs(syncOptions, responses, gdprConsent, uspConsent) {
return responses
Expand Down
2 changes: 1 addition & 1 deletion modules/adkernelAdnAnalyticsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const GVLID = 14;
const ANALYTICS_VERSION = '1.0.2';
const DEFAULT_QUEUE_TIMEOUT = 4000;
const DEFAULT_HOST = 'tag.adkernel.com';
const storageObj = getStorageManager(GVLID);
const storageObj = getStorageManager({gvlid: GVLID});

const ADK_HB_EVENTS = {
AUCTION_INIT: 'auctionInit',
Expand Down
2 changes: 1 addition & 1 deletion modules/adnuntiusBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const getSegmentsFromOrtb = function (ortb2) {
}

const handleMeta = function () {
const storage = getStorageManager(GVLID, 'adnuntius')
const storage = getStorageManager({gvlid: GVLID, bidderCode: BIDDER_CODE})
let adnMeta = null
if (storage.localStorageIsEnabled()) {
adnMeta = JSON.parse(storage.getDataFromLocalStorage('adn.metaData'))
Expand Down
2 changes: 1 addition & 1 deletion modules/adplusBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const BIDDER_CODE = 'adplus';
export const ADPLUS_ENDPOINT = 'https://ssp.ad-plus.com.tr/server/headerBidding';
export const DGID_CODE = 'adplus_dg_id';
export const SESSION_CODE = 'adplus_s_id';
export const storage = getStorageManager(undefined, BIDDER_CODE);
export const storage = getStorageManager({bidderCode: BIDDER_CODE});
const COOKIE_EXP = 1000 * 60 * 60 * 24; // 1 day
// #endregion

Expand Down
2 changes: 1 addition & 1 deletion modules/adqueryBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const ADQUERY_USER_SYNC_DOMAIN = ADQUERY_BIDDER_DOMAIN_PROTOCOL + '://' + ADQUER
const ADQUERY_DEFAULT_CURRENCY = 'PLN';
const ADQUERY_NET_REVENUE = true;
const ADQUERY_TTL = 360;
const storage = getStorageManager(ADQUERY_GVLID);
const storage = getStorageManager({gvlid: ADQUERY_GVLID, bidderCode: ADQUERY_BIDDER_CODE});

/** @type {BidderSpec} */
export const spec = {
Expand Down
2 changes: 1 addition & 1 deletion modules/adqueryIdSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import * as utils from '../src/utils.js';
const MODULE_NAME = 'qid';
const AU_GVLID = 902;

export const storage = getStorageManager(AU_GVLID, 'qid');
export const storage = getStorageManager({gvlid: AU_GVLID, moduleName: 'qid'});

/**
* Param or default.
Expand Down
2 changes: 1 addition & 1 deletion modules/adriverBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const BIDDER_CODE = 'adriver';
const ADRIVER_BID_URL = 'https://pb.adriver.ru/cgi-bin/bid.cgi';
const TIME_TO_LIVE = 3000;

export const storage = getStorageManager(BIDDER_CODE);
export const storage = getStorageManager({bidderCode: BIDDER_CODE});
export const spec = {
code: BIDDER_CODE,

Expand Down
2 changes: 1 addition & 1 deletion modules/adtrueBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import {BANNER, NATIVE, VIDEO} from '../src/mediaTypes.js';
import {config} from '../src/config.js';
import {getStorageManager} from '../src/storageManager.js';

const storage = getStorageManager();
const BIDDER_CODE = 'adtrue';
const storage = getStorageManager({bidderCode: BIDDER_CODE});
const ADTRUE_CURRENCY = 'USD';
const ENDPOINT_URL = 'https://hb.adtrue.com/prebid/auction';
const LOG_WARN_PREFIX = 'AdTrue: ';
Expand Down
2 changes: 1 addition & 1 deletion modules/airgridRtdProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const SUBMODULE_NAME = 'airgrid';
const AG_TCF_ID = 782;
export const AG_AUDIENCE_IDS_KEY = 'edkt_matched_audience_ids'

export const storage = getStorageManager(AG_TCF_ID, SUBMODULE_NAME);
export const storage = getStorageManager({gvlid: AG_TCF_ID, moduleName: SUBMODULE_NAME});

/**
* Attach script tag to DOM
Expand Down
2 changes: 1 addition & 1 deletion modules/akamaiDapRtdProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const MODULE_NAME = 'realTimeData';
const SUBMODULE_NAME = 'dap';

export const SEGMENTS_STORAGE_KEY = 'akamaiDapSegments';
export const storage = getStorageManager(null, SUBMODULE_NAME);
export const storage = getStorageManager({gvlid: null, moduleName: SUBMODULE_NAME});

/**
* Lazy merge objects.
Expand Down
2 changes: 1 addition & 1 deletion modules/amxBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { config } from '../src/config.js';
import { getStorageManager } from '../src/storageManager.js';

const BIDDER_CODE = 'amx';
const storage = getStorageManager(737, BIDDER_CODE);
const storage = getStorageManager({gvlid: 737, bidderCode: BIDDER_CODE});
const SIMPLE_TLD_TEST = /\.com?\.\w{2,4}$/;
const DEFAULT_ENDPOINT = 'https://prebid.a-mo.net/a/c';
const VERSION = 'pba1.3.1';
Expand Down
40 changes: 38 additions & 2 deletions modules/appnexusBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const SCRIPT_TAG_START = '<script';
const VIEWABILITY_URL_START = /\/\/cdn\.adnxs\.com\/v|\/\/cdn\.adnxs\-simple\.com\/v/;
const VIEWABILITY_FILE_NAME = 'trk.js';
const GVLID = 32;
const storage = getStorageManager(GVLID, BIDDER_CODE);
const storage = getStorageManager({gvlid: GVLID, bidderCode: BIDDER_CODE});

export const spec = {
code: BIDDER_CODE,
Expand Down Expand Up @@ -367,11 +367,20 @@ export const spec = {
},

transformBidParams: function (params, isOpenRtb) {
let conversionFn = transformBidderParamKeywords;
if (isOpenRtb === true) {
let s2sConfig = config.getConfig('s2sConfig');
let s2sEndpointUrl = deepAccess(s2sConfig, 'endpoint.p1Consent');
if (s2sEndpointUrl && s2sEndpointUrl.match('/openrtb2/prebid')) {
conversionFn = convertKeywordsToString;
}
}

params = convertTypes({
'member': 'string',
'invCode': 'string',
'placementId': 'number',
'keywords': transformBidderParamKeywords,
'keywords': conversionFn,
'publisherId': 'number'
}, params);

Expand Down Expand Up @@ -1164,4 +1173,31 @@ function getBidFloor(bid) {
return null;
}

// keywords: { 'genre': ['rock', 'pop'], 'pets': ['dog'] } goes to 'genre=rock,genre=pop,pets=dog'
function convertKeywordsToString(keywords) {
let result = '';
Object.keys(keywords).forEach(key => {
// if 'text' or ''
if (isStr(keywords[key])) {
if (keywords[key] !== '') {
result += `${key}=${keywords[key]},`
} else {
result += `${key},`;
}
} else if (isArray(keywords[key])) {
if (keywords[key][0] === '') {
result += `${key},`
} else {
keywords[key].forEach(val => {
result += `${key}=${val},`
});
}
}
});

// remove last trailing comma
result = result.substring(0, result.length - 1);
return result;
}

registerBidder(spec);
2 changes: 1 addition & 1 deletion modules/apstreamBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const CONSTANTS = {
BIDDER_CODE: 'apstream',
GVLID: 394
};
const storage = getStorageManager(CONSTANTS.GVLID, CONSTANTS.BIDDER_CODE);
const storage = getStorageManager({gvlid: CONSTANTS.GVLID, bidderCode: CONSTANTS.BIDDER_CODE});

var dsuModule = (function() {
'use strict';
Expand Down
2 changes: 1 addition & 1 deletion modules/ccxBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { registerBidder } from '../src/adapters/bidderFactory.js'
import { config } from '../src/config.js'
import { getStorageManager } from '../src/storageManager.js';

const storage = getStorageManager();
const BIDDER_CODE = 'ccx'
const storage = getStorageManager({bidderCode: BIDDER_CODE});
const BID_URL = 'https://delivery.clickonometrics.pl/ortb/prebid/bid'
const SUPPORTED_VIDEO_PROTOCOLS = [2, 3, 5, 6]
const SUPPORTED_VIDEO_MIMES = ['video/mp4', 'video/x-flv']
Expand Down
25 changes: 21 additions & 4 deletions modules/colossussspBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import { getWindowTop, deepAccess, logMessage } from '../src/utils.js';
import { registerBidder } from '../src/adapters/bidderFactory.js';
import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
import { ajax } from '../src/ajax.js';
import { config } from '../src/config.js';

const BIDDER_CODE = 'colossusssp';
const G_URL = 'https://colossusssp.com/?c=o&m=multi';
const G_URL_SYNC = 'https://colossusssp.com/?c=o&m=cookie';
const G_URL_SYNC = 'https://sync.colossusssp.com';

function isBidResponseValid(bid) {
if (!bid.requestId || !bid.cpm || !bid.creativeId || !bid.ttl || !bid.currency) {
Expand Down Expand Up @@ -175,10 +176,26 @@ export const spec = {
return response;
},

getUserSyncs: () => {
getUserSyncs: (syncOptions, serverResponses, gdprConsent, uspConsent) => {
let syncType = syncOptions.iframeEnabled ? 'html' : 'hms.gif';
let syncUrl = G_URL_SYNC + `/${syncType}?pbjs=1`;
if (gdprConsent && gdprConsent.consentString) {
if (typeof gdprConsent.gdprApplies === 'boolean') {
syncUrl += `&gdpr=${Number(gdprConsent.gdprApplies)}&gdpr_consent=${gdprConsent.consentString}`;
} else {
syncUrl += `&gdpr=0&gdpr_consent=${gdprConsent.consentString}`;
}
}
if (uspConsent && uspConsent.consentString) {
syncUrl += `&ccpa_consent=${uspConsent.consentString}`;
}

const coppa = config.getConfig('coppa') ? 1 : 0;
syncUrl += `&coppa=${coppa}`;

return [{
type: 'image',
url: G_URL_SYNC
type: syncType,
url: syncUrl
}];
},

Expand Down
2 changes: 1 addition & 1 deletion modules/concertBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export const spec = {

registerBidder(spec);

const storage = getStorageManager();
const storage = getStorageManager({bidderCode: BIDDER_CODE});

/**
* Check or generate a UID for the current user.
Expand Down
2 changes: 1 addition & 1 deletion modules/conversantBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import {getStorageManager} from '../src/storageManager.js';
import { config } from '../src/config.js';

const GVLID = 24;
export const storage = getStorageManager(GVLID);

const BIDDER_CODE = 'conversant';
export const storage = getStorageManager({gvlid: GVLID, bidderCode: BIDDER_CODE});
const URL = 'https://web.hb.ad.cpe.dotomi.com/cvx/client/hb/ortb/25';

export const spec = {
Expand Down
2 changes: 1 addition & 1 deletion modules/craftBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {ajax} from '../src/ajax.js';
const BIDDER_CODE = 'craft';
const URL_BASE = 'https://gacraft.jp/prebid-v3';
const TTL = 360;
const storage = getStorageManager();
const storage = getStorageManager({bidderCode: BIDDER_CODE});

export const spec = {
code: BIDDER_CODE,
Expand Down
2 changes: 1 addition & 1 deletion modules/criteoBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const BIDDER_CODE = 'criteo';
const CDB_ENDPOINT = 'https://bidder.criteo.com/cdb';
const PROFILE_ID_INLINE = 207;
export const PROFILE_ID_PUBLISHERTAG = 185;
const storage = getStorageManager(GVLID);
const storage = getStorageManager({gvlid: GVLID, bidderCode: BIDDER_CODE});
const LOG_PREFIX = 'Criteo: ';

/*
Expand Down
2 changes: 1 addition & 1 deletion modules/criteoIdSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { getStorageManager } from '../src/storageManager.js';

const gvlid = 91;
const bidderCode = 'criteo';
export const storage = getStorageManager(gvlid, bidderCode);
export const storage = getStorageManager({gvlid: gvlid, moduleName: bidderCode});

const bididStorageKey = 'cto_bidid';
const bundleStorageKey = 'cto_bundle';
Expand Down
2 changes: 1 addition & 1 deletion modules/cwireBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const LS_CWID_KEY = 'cw_cwid';
const CW_GROUPS_QUERY = 'cwgroups';
const CW_CREATIVE_QUERY = 'cwcreative';

const storage = getStorageManager();
const storage = getStorageManager({bidderCode: BIDDER_CODE});

/**
* ------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion modules/datablocksBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { config } from '../src/config.js';
import { BANNER, NATIVE } from '../src/mediaTypes.js';
import { getStorageManager } from '../src/storageManager.js';
import { ajax } from '../src/ajax.js';
export const storage = getStorageManager();
export const storage = getStorageManager({bidderCode: 'datablocks'});

const NATIVE_ID_MAP = {};
const NATIVE_PARAMS = {
Expand Down
2 changes: 1 addition & 1 deletion modules/deepintentDpesIdSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { submodule } from '../src/hook.js';
import { getStorageManager } from '../src/storageManager.js';

const MODULE_NAME = 'deepintentId';
export const storage = getStorageManager(null, MODULE_NAME);
export const storage = getStorageManager({gvlid: null, moduleName: MODULE_NAME});

/** @type {Submodule} */
export const deepintentDpesSubmodule = {
Expand Down
3 changes: 1 addition & 2 deletions modules/eplanningBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ import { getGlobal } from '../src/prebidGlobal.js';
import { registerBidder } from '../src/adapters/bidderFactory.js';
import { getStorageManager } from '../src/storageManager.js';

export const storage = getStorageManager();

const BIDDER_CODE = 'eplanning';
export const storage = getStorageManager({bidderCode: BIDDER_CODE});
const rnd = Math.random();
const DEFAULT_SV = 'pbjs.e-planning.net';
const DEFAULT_ISV = 'i.e-planning.net';
Expand Down
2 changes: 1 addition & 1 deletion modules/gjirafaBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const SIZE_SEPARATOR = ';';
const BISKO_ID = 'biskoId';
const STORAGE_ID = 'bisko-sid';
const SEGMENTS = 'biskoSegments';
const storage = getStorageManager();
const storage = getStorageManager({bidderCode: BIDDER_CODE});

export const spec = {
code: BIDDER_CODE,
Expand Down
3 changes: 1 addition & 2 deletions modules/glimpseBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ import { getStorageManager } from '../src/storageManager.js'
import { isArray } from '../src/utils.js'
import { registerBidder } from '../src/adapters/bidderFactory.js'

const storageManager = getStorageManager()

const GVLID = 1012
const BIDDER_CODE = 'glimpse'
const storageManager = getStorageManager({bidderCode: BIDDER_CODE})
const ENDPOINT = 'https://api.glimpsevault.io/ads/serving/public/v1/prebid'
const LOCAL_STORAGE_KEY = {
vault: {
Expand Down
2 changes: 1 addition & 1 deletion modules/gmosspBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { getStorageManager } from '../src/storageManager.js';

const BIDDER_CODE = 'gmossp';
const ENDPOINT = 'https://sp.gmossp-sp.jp/hb/prebid/query.ad';
const storage = getStorageManager();
const storage = getStorageManager({bidderCode: BIDDER_CODE});

export const spec = {
code: BIDDER_CODE,
Expand Down
17 changes: 11 additions & 6 deletions modules/googleAnalyticsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,13 @@ function sendBidRequestToGa(bid) {
_analyticsQueue.push(function () {
_eventCount++;
if (_sendFloors) {
var floor = (bid.floorMin) ? bid.floorMin : 'No Floor';
window[_gaGlobal](_trackerSend, 'event', _category, 'Requests by Floor=' + floor, 'Ad Unit=' + bid.adUnitCode + ',' + bid.bidderCode, 1, _disableInteraction);
var floor = 'No Floor';
if (bid.floorData) {
floor = bid.floorData.floorValue;
} else if (bid.bids.length) {
floor = bid.bids[0].getFloor().floor;
}
window[_gaGlobal](_trackerSend, 'event', _category, 'Requests by Floor=' + floor, bid.bidderCode, 1, _disableInteraction);
} else {
window[_gaGlobal](_trackerSend, 'event', _category, 'Requests', bid.bidderCode, 1, _disableInteraction);
}
Expand Down Expand Up @@ -239,8 +244,8 @@ function sendBidResponseToGa(bid) {
window[_gaGlobal](_trackerSend, 'event', 'Prebid.js CPM Distribution', cpmDis, bidder, 1, _disableInteraction);
}
if (_sendFloors) {
var floor = (bid.floorMin) ? bid.floorMin : 'No Floor';
window[_gaGlobal](_trackerSend, 'event', _category, 'Bids by Floor=' + floor, 'Ad Unit=' + bid.adUnitCode + ',' + bidder, cpmCents, _disableInteraction);
var floor = (bid.floorData) ? bid.floorData.floorValue : 'No Floor';
window[_gaGlobal](_trackerSend, 'event', _category, 'Bids by Floor=' + floor, 'Size=' + bid.size + ',' + bidder, cpmCents, _disableInteraction);
} else {
window[_gaGlobal](_trackerSend, 'event', _category, 'Bids', bidder, cpmCents, _disableInteraction);
}
Expand Down Expand Up @@ -270,8 +275,8 @@ function sendBidWonToGa(bid) {
_analyticsQueue.push(function () {
_eventCount++;
if (_sendFloors) {
var floor = (bid.floorMin) ? bid.floorMin : 'No Floor';
window[_gaGlobal](_trackerSend, 'event', _category, 'Wins by Floor=' + floor, 'Ad Unit=' + bid.adUnitCode + ',' + bid.bidderCode, cpmCents, _disableInteraction);
var floor = (bid.floorData) ? bid.floorData.floorValue : 'No Floor';
window[_gaGlobal](_trackerSend, 'event', _category, 'Wins by Floor=' + floor, 'Size=' + bid.size + ',' + bid.bidderCode, cpmCents, _disableInteraction);
} else {
window[_gaGlobal](_trackerSend, 'event', _category, 'Wins', bid.bidderCode, cpmCents, _disableInteraction);
}
Expand Down
Loading

0 comments on commit 780e3c7

Please sign in to comment.