Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/prebid/Prebid.js
Browse files Browse the repository at this point in the history
* 'master' of https://github.com/prebid/Prebid.js:
  Revert "New LuponMedia Bid Adapter (prebid#5120)" (prebid#5145)
  New LuponMedia Bid Adapter (prebid#5120)
  Feature/send publisher domain (prebid#5121)
  update test adunit params (prebid#5135)
  add parameter to the conversant adapter to override the url (prebid#5133)
  Replace call to old url module with call to utils (prebid#5136)
  GumGum: uses encodeURIComponent inline (prebid#5124)
  User ID's (liveramp, britepool) and gdpr (prebid#5114)
  fix wipes adapter response (prebid#5134)
  Submitting Tercept Analytics Adapter (prebid#5099)
  hotfix - undefined consent (prebid#5127)
  parrableIdSystem: Send current page location to back-end (prebid#5123)
  Increment pre version
  Prebid 3.16.0 Release
  Use a deepmerge function to merge both globa level config & bidder specific config (prebid#5039)
  Update appnexusBidAdapter.js (prebid#4893)
  Quantcast: Block bids without purpose 1 consent (prebid#5046)
  ShowHeroes adapter v2 (prebid#5085)
  Qc/qc usersyncs (prebid#4923)
  • Loading branch information
redaguermas committed Apr 20, 2020
2 parents 51525d7 + 198f63e commit 6b11e52
Show file tree
Hide file tree
Showing 28 changed files with 1,721 additions and 96 deletions.
2 changes: 1 addition & 1 deletion modules/appnexusBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const storage = getStorageManager(GVLID, BIDDER_CODE);
export const spec = {
code: BIDDER_CODE,
gvlid: GVLID,
aliases: ['appnexusAst', 'brealtime', 'emxdigital', 'pagescience', 'defymedia', 'gourmetads', 'matomy', 'featureforward', 'oftmedia', 'districtm', 'adasta'],
aliases: ['appnexusAst', 'brealtime', 'emxdigital', 'pagescience', 'defymedia', 'gourmetads', 'matomy', 'featureforward', 'oftmedia', 'districtm', 'adasta', 'beintoo'],
supportedMediaTypes: [BANNER, VIDEO, NATIVE],

/**
Expand Down
2 changes: 1 addition & 1 deletion modules/atsAnalyticsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function bidRequestedHandler(args) {
user_browser: (browserIsFirefox() || browserIsEdge() || browserIsChrome() || browserIsSafari()),
user_platform: navigator.platform,
auction_start: new Date(args.auctionStart).toJSON(),
domain: args.refererInfo.referer,
domain: window.location.hostname,
pid: atsAnalyticsAdapter.context.pid,
};
});
Expand Down
30 changes: 28 additions & 2 deletions modules/colossussspBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@ function isBidResponseValid(bid) {
}
}

function getUserId(eids, id, source, uidExt) {
if (id) {
var uid = { id };
if (uidExt) {
uid.ext = uidExt;
}
eids.push({
source,
uids: [ uid ]
});
}
}

export const spec = {
code: BIDDER_CODE,
supportedMediaTypes: [BANNER, VIDEO, NATIVE],
Expand Down Expand Up @@ -60,13 +73,17 @@ export const spec = {
'secure': location.protocol === 'https:' ? 1 : 0,
'host': location.host,
'page': location.pathname,
'placements': placements
'placements': placements,
};

if (bidderRequest) {
if (bidderRequest.uspConsent) {
request.ccpa = bidderRequest.uspConsent;
}
if (bidderRequest.gdprConsent) {
request.gdpr_consent = bidderRequest.gdprConsent.consentString || 'ALL'
request.gdpr_require = bidderRequest.gdprConsent.gdprApplies ? 1 : 0
}
}

for (let i = 0; i < validBidRequests.length; i++) {
Expand All @@ -76,11 +93,20 @@ export const spec = {
placementId: bid.params.placement_id,
bidId: bid.bidId,
sizes: bid.mediaTypes[traff].sizes,
traffic: traff
traffic: traff,
eids: []
};
if (bid.schain) {
placement.schain = bid.schain;
}
if (bid.userId) {
getUserId(placement.eids, bid.userId.britepoolid, 'britepool.com');
getUserId(placement.eids, bid.userId.idl_env, 'identityLink');
getUserId(placement.eids, bid.userId.id5id, 'id5-sync.com')
getUserId(placement.eids, bid.userId.tdid, 'adserver.org', {
rtiPartner: 'TDID'
});
}
placements.push(placement);
}
return {
Expand Down
6 changes: 5 additions & 1 deletion modules/conversantBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export const spec = {
let requestId = '';
let pubcid = null;
let pubcidName = '_pubcid';
let bidurl = URL;

const conversantImps = validBidRequests.map(function(bid) {
const bidfloor = utils.getBidIdParameter('bidfloor', bid.params);
Expand Down Expand Up @@ -109,6 +110,9 @@ export const spec = {
} else if (bid.crumbs && bid.crumbs.pubcid) {
pubcid = bid.crumbs.pubcid;
}
if (bid.params.white_label_url) {
bidurl = bid.params.white_label_url;
}

return imp;
});
Expand Down Expand Up @@ -164,7 +168,7 @@ export const spec = {

return {
method: 'POST',
url: URL,
url: bidurl,
data: payload,
};
},
Expand Down
1 change: 1 addition & 0 deletions modules/conversantBidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ var adUnits = [
site_id: '108060',
api: [2],
protocols: [1, 2],
white_label_url: 'https://web.hb.ad.cpe.dotomi.com/s2s/header/24',
mimes: ['video/mp4']
}
}]
Expand Down
2 changes: 1 addition & 1 deletion modules/gumgumBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function _getBrowserParams(topWindowUrl) {
pu: topUrl,
ce: storage.cookiesAreEnabled(),
dpr: topWindow.devicePixelRatio || 1,
jcsi: JSON.stringify({ t: 0, rq: 8 }),
jcsi: encodeURIComponent(JSON.stringify({ t: 0, rq: 8 })),
ogu: getOgURL()
}

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

getUserSyncs: function getUserSyncs(syncOptions, responses, gdprConsent, uspConsent) {
let url = 'https://pre.ads.justpremium.com/v/1.0/t/sync' + '?_c=' + 'a' + Math.random().toString(36).substring(7) + Date.now();
if (gdprConsent && (typeof gdprConsent.gdprApplies === 'boolean')) {
if (gdprConsent && (typeof gdprConsent.gdprApplies === 'boolean') && gdprConsent.gdprApplies && gdprConsent.consentString) {
url = url + '&consentString=' + encodeURIComponent(gdprConsent.consentString)
}
if (uspConsent) {
Expand Down
10 changes: 7 additions & 3 deletions modules/parrableIdSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
*/

import * as utils from '../src/utils.js'
import {ajax} from '../src/ajax.js';
import {submodule} from '../src/hook.js';
import { ajax } from '../src/ajax.js';
import { submodule } from '../src/hook.js';
import { getRefererInfo } from '../src/refererDetection.js';

const PARRABLE_URL = 'https://h.parrable.com/prebid';

Expand All @@ -26,9 +27,12 @@ function isValidConfig(configParams) {
function fetchId(configParams, consentData, currentStoredId) {
if (!isValidConfig(configParams)) return;

const refererInfo = getRefererInfo();

const data = {
eid: currentStoredId || null,
trackers: configParams.partner.split(',')
trackers: configParams.partner.split(','),
url: refererInfo.referer
};

const searchParams = {
Expand Down
71 changes: 71 additions & 0 deletions modules/quantcastBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@ import * as utils from '../src/utils.js';
import { ajax } from '../src/ajax.js';
import { config } from '../src/config.js';
import { registerBidder } from '../src/adapters/bidderFactory.js';
import find from 'core-js/library/fn/array/find.js';

const BIDDER_CODE = 'quantcast';
const DEFAULT_BID_FLOOR = 0.0000000001;

const QUANTCAST_VENDOR_ID = '11';
// Check other required purposes on server
const PURPOSE_DATA_COLLECT = '1';

export const QUANTCAST_DOMAIN = 'qcx.quantserve.com';
export const QUANTCAST_TEST_DOMAIN = 's2s-canary.quantserve.com';
export const QUANTCAST_NET_REVENUE = true;
Expand Down Expand Up @@ -72,6 +77,35 @@ function getDomain(url) {
return url.replace('http://', '').replace('https://', '').replace('www.', '').split(/[/?#]/)[0];
}

function checkTCFv1(vendorData) {
let vendorConsent = vendorData.vendorConsents && vendorData.vendorConsents[QUANTCAST_VENDOR_ID];
let purposeConsent = vendorData.purposeConsents && vendorData.purposeConsents[PURPOSE_DATA_COLLECT];

return !!(vendorConsent && purposeConsent);
}

function checkTCFv2(tcData) {
if (tcData.purposeOneTreatment && tcData.publisherCC === 'DE') {
// special purpose 1 treatment for Germany
return true;
}

let restrictions = tcData.publisher ? tcData.publisher.restrictions : {};
let qcRestriction = restrictions && restrictions[PURPOSE_DATA_COLLECT]
? restrictions[PURPOSE_DATA_COLLECT][QUANTCAST_VENDOR_ID]
: null;

if (qcRestriction === 0 || qcRestriction === 2) {
// Not allowed by publisher, or requires legitimate interest
return false;
}

let vendorConsent = tcData.vendor && tcData.vendor.consents && tcData.vendor.consents[QUANTCAST_VENDOR_ID];
let purposeConsent = tcData.purpose && tcData.purpose.consents && tcData.purpose.consents[PURPOSE_DATA_COLLECT];

return !!(vendorConsent && purposeConsent);
}

/**
* The documentation for Prebid.js Adapter 1.0 can be found at link below,
* http://prebid.org/dev-docs/bidder-adapter-1.html
Expand All @@ -80,6 +114,7 @@ export const spec = {
code: BIDDER_CODE,
GVLID: 11,
supportedMediaTypes: ['banner', 'video'],
hasUserSynced: false,

/**
* Verify the `AdUnits.bids` response with `true` for valid request and `false`
Expand Down Expand Up @@ -108,6 +143,21 @@ export const spec = {
const page = utils.deepAccess(bidderRequest, 'refererInfo.canonicalUrl') || config.getConfig('pageUrl') || utils.deepAccess(window, 'location.href');
const domain = getDomain(page);

// Check for GDPR consent for purpose 1, and drop request if consent has not been given
// Remaining consent checks are performed server-side.
if (gdprConsent.gdprApplies) {
if (gdprConsent.vendorData) {
if (gdprConsent.apiVersion === 1 && !checkTCFv1(gdprConsent.vendorData)) {
utils.logInfo(`${BIDDER_CODE}: No purpose 1 consent for TCF v1`);
return;
}
if (gdprConsent.apiVersion === 2 && !checkTCFv2(gdprConsent.vendorData)) {
utils.logInfo(`${BIDDER_CODE}: No purpose 1 consent for TCF v2`);
return;
}
}
}

let bidRequestsList = [];

bids.forEach(bid => {
Expand Down Expand Up @@ -223,6 +273,27 @@ export const spec = {
onTimeout(timeoutData) {
const url = `${QUANTCAST_PROTOCOL}://${QUANTCAST_DOMAIN}:${QUANTCAST_PORT}/qchb_notify?type=timeout`;
ajax(url, null, null);
},
getUserSyncs(syncOptions, serverResponses) {
const syncs = []
if (!this.hasUserSynced && syncOptions.pixelEnabled) {
const responseWithUrl = find(serverResponses, serverResponse =>
utils.deepAccess(serverResponse.body, 'userSync.url')
);

if (responseWithUrl) {
const url = utils.deepAccess(responseWithUrl.body, 'userSync.url')
syncs.push({
type: 'image',
url: url
});
}
this.hasUserSynced = true;
}
return syncs;
},
resetUserSync() {
this.hasUserSynced = false;
}
};

Expand Down
10 changes: 8 additions & 2 deletions modules/quantcastBidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ const adUnits = [{
battr: [1, 2] // OPTIONAL - Array of blocked creative attributes as per OpenRTB Spec List 5.3
}
}
]
],
userSync: {
url: 'https://quantcast.com/pixelUrl'
}
}];
```

Expand Down Expand Up @@ -63,6 +66,9 @@ var adUnits = [{
}
}
}
]
],
userSync: {
url: 'https://quantcast.com/pixelUrl'
}
}];
```
Loading

0 comments on commit 6b11e52

Please sign in to comment.