Skip to content

Commit

Permalink
Merge branch 'prebid_upgrade_3_18_0_20200506145339' of https://github…
Browse files Browse the repository at this point in the history
  • Loading branch information
pm-shashank-jain committed May 8, 2020
2 parents c05f9ec + de80a52 commit 3908538
Show file tree
Hide file tree
Showing 219 changed files with 17,649 additions and 2,019 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ module.exports = {
// override the regular exclusion from above (for being inside node_modules).
{
test: /.js$/,
include: new RegExp(`\\${path.sep}prebid\.js`),
include: new RegExp(`\\${path.sep}prebid\\.js`),
use: {
loader: 'babel-loader',
// presets and plugins for Prebid.js must be manually specified separate from your other babel rule.
Expand Down
15 changes: 8 additions & 7 deletions allowedModules.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

const sharedWhiteList = [
"core-js/library/fn/array/find", // no ie11
"core-js/library/fn/array/includes", // no ie11
"core-js/library/fn/set", // ie11 supports Set but not Set#values
"core-js/library/fn/string/includes", // no ie11
"core-js/library/fn/number/is-integer", // no ie11,
"core-js/library/fn/array/from" // no ie11
'core-js/library/fn/array/find', // no ie11
'core-js/library/fn/array/includes', // no ie11
'core-js/library/fn/set', // ie11 supports Set but not Set#values
'core-js/library/fn/string/includes', // no ie11
'core-js/library/fn/number/is-integer', // no ie11,
'core-js/library/fn/array/from' // no ie11
];

module.exports = {
Expand All @@ -21,6 +21,7 @@ module.exports = {
'fun-hooks/no-eval',
'just-clone',
'dlv',
'dset'
'dset',
'deep-equal'
]
};
9 changes: 9 additions & 0 deletions integrationExamples/gpt/digitrust_Simple.html
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@
}
else {
console.error('Digitrust init failed');
if(digiTrustResult.err){
console.error(digiTrustResult.err);
}
}
}
},
Expand All @@ -157,6 +160,12 @@
expires: 60
}
}]
},
userIdTargeting: {
"GAM": true,
"GAM_KEYS": {
"tdid": "TTD_ID" // send tdid as TTD_ID
}
}
});
pbjs.addAdUnits(adUnits);
Expand Down
25 changes: 20 additions & 5 deletions modules/adagioBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import sha256 from 'crypto-js/sha256.js';
import { getStorageManager } from '../src/storageManager.js';

const BIDDER_CODE = 'adagio';
const VERSION = '2.1.0';
const VERSION = '2.2.1';
const FEATURES_VERSION = '1';
const ENDPOINT = 'https://mp.4dex.io/prebid';
const SUPPORTED_MEDIA_TYPES = ['banner'];
const ADAGIO_TAG_URL = 'https://script.4dex.io/localstore.js';
const ADAGIO_LOCALSTORAGE_KEY = 'adagioScript';
const GVLID = 617;
const storage = getStorageManager(GVLID);
const storage = getStorageManager(GVLID, 'adagio');

export const ADAGIO_PUBKEY = `-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC9el0+OEn6fvEh1RdVHQu4cnT0
Expand All @@ -23,10 +23,8 @@ t0b0lsHN+W4n9kitS/DZ/xnxWK/9vxhv0ZtL1LL/rwR5Mup7rmJbNtDoNBw4TIGj
pV6EP3MTLosuUEpLaQIDAQAB
-----END PUBLIC KEY-----`;

export function getAdagioScript() {
export function adagioScriptFromLocalStorageCb(ls) {
try {
const ls = storage.getDataFromLocalStorage(ADAGIO_LOCALSTORAGE_KEY);

if (!ls) {
utils.logWarn('Adagio Script not found');
return;
Expand Down Expand Up @@ -58,6 +56,12 @@ export function getAdagioScript() {
}
}

export function getAdagioScript() {
storage.getDataFromLocalStorage(ADAGIO_LOCALSTORAGE_KEY, (ls) => {
adagioScriptFromLocalStorageCb(ls)
});
}

function canAccessTopWindow() {
try {
if (utils.getWindowTop().location.href) {
Expand Down Expand Up @@ -338,10 +342,19 @@ function _getGdprConsent(bidderRequest) {
if (bidderRequest.gdprConsent.allowAuctionWithoutConsent !== undefined) {
consent.allowAuctionWithoutConsent = bidderRequest.gdprConsent.allowAuctionWithoutConsent ? 1 : 0;
}
if (bidderRequest.gdprConsent.apiVersion !== undefined) {
consent.apiVersion = bidderRequest.gdprConsent.apiVersion;
}
}
return consent;
}

function _getSchain(bidRequest) {
if (utils.deepAccess(bidRequest, 'schain')) {
return bidRequest.schain;
}
}

export const spec = {
code: BIDDER_CODE,
gvlid: GVLID,
Expand Down Expand Up @@ -394,6 +407,7 @@ export const spec = {
const site = _getSite();
const pageviewId = _getPageviewId();
const gdprConsent = _getGdprConsent(bidderRequest);
const schain = _getSchain(validBidRequests[0]);
const adUnits = utils._map(validBidRequests, (bidRequest) => {
bidRequest.features = _getFeatures(bidRequest);
return bidRequest;
Expand Down Expand Up @@ -422,6 +436,7 @@ export const spec = {
pageviewId: pageviewId,
adUnits: groupedAdUnits[organizationId],
gdpr: gdprConsent,
schain: schain,
prebidVersion: '$prebid.version$',
adapterVersion: VERSION,
featuresVersion: FEATURES_VERSION
Expand Down
86 changes: 45 additions & 41 deletions modules/adgenerationBidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,57 +15,61 @@ AdGeneration bid adapter supports Banner and Native.
# Test Parameters
```
var adUnits = [
// Banner adUnit
{
code: 'banner-div', // banner
sizes: [[300, 250]],
bids: [
{
bidder: 'adg',
params: {
id: '58278', // banner
}
},
]
},
// Native adUnit
{
code: 'native-div',
sizes: [[1,1]],
mediaTypes: {
native: {
image: {
// Banner adUnit
{
code: 'banner-div', // banner
mediaTypes: {
banner: {
sizes: [[300, 250]],
}
},
bids: [
{
bidder: 'adg',
params: {
id: '58278', // banner
}
},
]
},
// Native adUnit
{
code: 'native-div',
sizes: [[1,1]],
mediaTypes: {
native: {
image: {
required: true
},
title: {
},
title: {
required: true,
len: 80
},
sponsoredBy: {
},
sponsoredBy: {
required: true
},
clickUrl: {
},
clickUrl: {
required: true
},
body: {
},
body: {
required: true
},
icon: {
},
icon: {
required: true
},
privacyLink: {
},
privacyLink: {
required: true
},
},
},
bids: [
{
bidder: 'adg',
params: {
},
},
bids: [
{
bidder: 'adg',
params: {
id: '58279', //native
}
},
]
}
},
]
},
];
```
6 changes: 5 additions & 1 deletion modules/adheseBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,15 @@ function getAdDetails(ad) {
if (isAdheseAd(ad)) {
creativeId = ad.id;
dealId = ad.orderId;
originData = { priority: ad.priority, orderProperty: ad.orderProperty, adFormat: ad.adFormat, adType: ad.adType, libId: ad.libId, adspaceId: ad.adspaceId, viewableImpressionCounter: ad.viewableImpressionCounter };
originData = { priority: ad.priority, orderProperty: ad.orderProperty, adFormat: ad.adFormat, adType: ad.adType, libId: ad.libId, adspaceId: ad.adspaceId, viewableImpressionCounter: ad.viewableImpressionCounter, slotId: ad.slotID, slotName: ad.slotName, advertiserId: ad.advertiserId, adId: ad.id };
} else {
creativeId = ad.origin + (ad.originInstance ? '-' + ad.originInstance : '');
if (ad.originData) {
originData = ad.originData;
originData.slotId = ad.slotID;
originData.slotName = ad.slotName;
originData.adType = ad.adType;
if (ad.adFormat) originData.adFormat = ad.adFormat;
if (ad.originData.seatbid && ad.originData.seatbid.length) {
const seatbid = ad.originData.seatbid[0];
if (seatbid.bid && seatbid.bid.length) {
Expand Down
7 changes: 3 additions & 4 deletions modules/adkernelAdnAnalyticsAdapter.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import adapter from '../src/AnalyticsAdapter.js';
import CONSTANTS from '../src/constants.json';
import adapterManager from '../src/adapterManager.js';
import {parse} from '../src/url.js';
import * as utils from '../src/utils.js';
import {ajax} from '../src/ajax.js';
import { getStorageManager } from '../src/storageManager.js';
Expand Down Expand Up @@ -211,7 +210,7 @@ export function getUmtSource(pageUrl, referrer) {
if (se) {
return asUtm(se, ORGANIC, ORGANIC);
}
let parsedUrl = parse(pageUrl);
let parsedUrl = utils.parseUrl(pageUrl);
let [refHost, refPath] = getReferrer(referrer);
if (refHost && refHost !== parsedUrl.hostname) {
return asUtm(refHost, REFERRAL, REFERRAL, '', refPath);
Expand All @@ -238,12 +237,12 @@ export function getUmtSource(pageUrl, referrer) {
}

function getReferrer(referrer) {
let ref = parse(referrer);
let ref = utils.parseUrl(referrer);
return [ref.hostname, ref.pathname];
}

function getUTM(pageUrl) {
let urlParameters = parse(pageUrl).search;
let urlParameters = utils.parseUrl(pageUrl).search;
if (!urlParameters['utm_campaign'] || !urlParameters['utm_source']) {
return;
}
Expand Down
3 changes: 1 addition & 2 deletions modules/adkernelAdnBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as utils from '../src/utils.js';
import {registerBidder} from '../src/adapters/bidderFactory.js';
import {BANNER, VIDEO} from '../src/mediaTypes.js';
import {parse as parseUrl} from '../src/url.js';

const DEFAULT_ADKERNEL_DSP_DOMAIN = 'tag.adkernel.com';
const DEFAULT_MIMES = ['video/mp4', 'video/webm', 'application/x-shockwave-flash', 'application/javascript'];
Expand Down Expand Up @@ -71,7 +70,7 @@ function buildRequestParams(tags, auctionId, transactionId, gdprConsent, uspCons
}

function buildSite(refInfo) {
let loc = parseUrl(refInfo.referer);
let loc = utils.parseUrl(refInfo.referer);
let result = {
page: `${loc.protocol}://${loc.hostname}${loc.pathname}`,
secure: ~~(loc.protocol === 'https')
Expand Down
Loading

0 comments on commit 3908538

Please sign in to comment.