Skip to content

Commit 6e3f8dd

Browse files
authored
Prebid 7: refactoring of refererInfo, pageUrl, publisherDomain (#8450)
* Squashed commit of the following: commit ef322e9964924bcdbe9548e56df69b00b000f642 Merge: 9c1b79086 a8c4a80 Author: Demetrio Girardi <[email protected]> Date: Mon May 23 12:08:14 2022 -0700 Merge branch 'prebid-7' into referer commit 9c1b7908659aaf904abd2bc4fcf53cd42a5b81cc Author: Demetrio Girardi <[email protected]> Date: Mon May 23 12:03:29 2022 -0700 fix lint commit 4d21818db17e08c038153eb2c77a1c7ebace13be Author: Demetrio Girardi <[email protected]> Date: Mon May 23 11:55:18 2022 -0700 convert bidders: rtbhouse commit 056c3172dcbae31ef1b7c63b5d033a5df713f0be Author: Demetrio Girardi <[email protected]> Date: Mon May 23 11:49:20 2022 -0700 convert bidders: richaudience commit 3b95d559a8075345da16ab59bca40def2572ee1c Author: Demetrio Girardi <[email protected]> Date: Mon May 23 11:12:43 2022 -0700 convert bidders: revcontent commit 9c3acfc9c86d9dc7c1928f21855288110ab87a8e Author: Demetrio Girardi <[email protected]> Date: Mon May 23 11:01:40 2022 -0700 convert bidders: relaid commit 65dbe122a7156ea1b380db37c083a90a0e7aa11a Author: Demetrio Girardi <[email protected]> Date: Mon May 23 10:47:48 2022 -0700 convert bidders: quantcast commit dc8fbb0c147c3229c8ceb4528b049a053b03b276 Author: Demetrio Girardi <[email protected]> Date: Mon May 23 10:33:06 2022 -0700 convert bidders: pulsepoint commit 775ca874aaac052dae51498db10910cf25f51fbe Author: Demetrio Girardi <[email protected]> Date: Mon May 23 10:26:51 2022 -0700 convert bidders: pubmatic commit 60df0651fc27524100e944edca457a3ef95e1f4c Author: Demetrio Girardi <[email protected]> Date: Mon May 23 10:07:58 2022 -0700 convert bidders: otm commit 5ec60e4 Author: Demetrio Girardi <[email protected]> Date: Fri May 20 12:44:58 2022 -0700 convert bidders: operaads commit e6bd48c Author: Demetrio Girardi <[email protected]> Date: Fri May 20 12:21:01 2022 -0700 convert bidders: missena commit d0703d4 Author: Demetrio Girardi <[email protected]> Date: Fri May 20 12:00:38 2022 -0700 convert bidders: microad commit 8da461f Author: Demetrio Girardi <[email protected]> Date: Fri May 20 11:47:18 2022 -0700 convert bidders: mediakeys commit 15ee1b4 Author: Demetrio Girardi <[email protected]> Date: Fri May 20 11:35:24 2022 -0700 convert bidders: luponmedia commit ab4e778 Author: Demetrio Girardi <[email protected]> Date: Fri May 20 11:32:52 2022 -0700 convert bidders: loglyft commit f6c3be0 Author: Demetrio Girardi <[email protected]> Date: Fri May 20 11:25:01 2022 -0700 convert bidders: livewrapped commit e2260b6 Author: Demetrio Girardi <[email protected]> Date: Fri May 20 11:20:34 2022 -0700 convert bidders: kubient commit 50f0610 Author: Demetrio Girardi <[email protected]> Date: Fri May 20 11:18:34 2022 -0700 convert bidders: kobler commit 8ba55cd Author: Demetrio Girardi <[email protected]> Date: Fri May 20 11:11:44 2022 -0700 convert bidders: ix commit 4486b4f Author: Demetrio Girardi <[email protected]> Date: Fri May 20 10:55:59 2022 -0700 convert bidders: iqm commit f95f031 Author: Demetrio Girardi <[email protected]> Date: Fri May 20 10:41:11 2022 -0700 convert bidders: iprom commit cead162 Author: Demetrio Girardi <[email protected]> Date: Fri May 20 10:38:11 2022 -0700 convert bidders: insticator commit 729a870 Author: Demetrio Girardi <[email protected]> Date: Fri May 20 10:36:08 2022 -0700 convert bidders: inskin commit 93d6a47 Author: Demetrio Girardi <[email protected]> Date: Fri May 20 10:35:07 2022 -0700 convert bidders: inmar commit 1105c2a Author: Demetrio Girardi <[email protected]> Date: Fri May 20 10:34:03 2022 -0700 convert bidders: improveddigital commit 535ff28 Author: Demetrio Girardi <[email protected]> Date: Fri May 20 10:30:13 2022 -0700 convert bidders: hybrid commit 561b10b Author: Demetrio Girardi <[email protected]> Date: Fri May 20 10:27:31 2022 -0700 convert bidders: gumgum commit 1fcf289 Author: Demetrio Girardi <[email protected]> Date: Fri May 20 10:24:35 2022 -0700 convert bidders: grid commit 46bf009 Author: Demetrio Girardi <[email protected]> Date: Fri May 20 10:16:13 2022 -0700 convert bidders: gmoss commit 37c735a Author: Demetrio Girardi <[email protected]> Date: Fri May 20 10:13:33 2022 -0700 convert bidders: glomex commit 9feb6f5 Author: Demetrio Girardi <[email protected]> Date: Fri May 20 10:07:43 2022 -0700 convert bidders: glimpse commit 90a3134 Author: Demetrio Girardi <[email protected]> Date: Fri May 20 10:04:49 2022 -0700 do not remove www in parseDomain commit 6aeecac Author: Demetrio Girardi <[email protected]> Date: Fri May 20 10:01:51 2022 -0700 convert bidders: gamoshi commit 8b66ebb Author: Demetrio Girardi <[email protected]> Date: Fri May 20 09:54:23 2022 -0700 convert bidders: feedad commit effdac6 Author: Demetrio Girardi <[email protected]> Date: Fri May 20 09:53:16 2022 -0700 convert bidders: fabrick commit c9f3a95 Author: Demetrio Girardi <[email protected]> Date: Fri May 20 09:51:15 2022 -0700 convert bidders: eplanning commit 2a93dab Author: Demetrio Girardi <[email protected]> Date: Fri May 20 09:38:55 2022 -0700 convert bidders: emx commit 7f5c15a Author: Demetrio Girardi <[email protected]> Date: Fri May 20 09:31:43 2022 -0700 convert bidders: deltaprojects commit ce45157 Author: Demetrio Girardi <[email protected]> Date: Fri May 20 09:18:27 2022 -0700 convert bidders: criteoId commit 985dcbc Author: Demetrio Girardi <[email protected]> Date: Fri May 20 09:14:29 2022 -0700 convert bidders: criteo commit 5cf6955 Author: Demetrio Girardi <[email protected]> Date: Fri May 20 09:05:44 2022 -0700 convert bidders: conversant commit edf8b41 Author: Demetrio Girardi <[email protected]> Date: Fri May 20 09:02:25 2022 -0700 convert bidders: connecta commit e5c71dd Author: Demetrio Girardi <[email protected]> Date: Fri May 20 08:59:02 2022 -0700 convert bidders: concert commit 29cd262 Author: Demetrio Girardi <[email protected]> Date: Fri May 20 08:54:51 2022 -0700 convert bidders: codefuel commit f5c6357 Author: Demetrio Girardi <[email protected]> Date: Fri May 20 08:54:05 2022 -0700 convert bidders: cleanmedia commit abd70f9 Author: Demetrio Girardi <[email protected]> Date: Fri May 20 08:47:54 2022 -0700 convert bidders: brightcom commit a04ad82 Author: Demetrio Girardi <[email protected]> Date: Fri May 20 08:42:14 2022 -0700 convert bidders: bridgewell commit a237df5 Author: Demetrio Girardi <[email protected]> Date: Fri May 20 08:39:44 2022 -0700 convert bidders: brave commit 94337ef Author: Demetrio Girardi <[email protected]> Date: Fri May 20 08:26:21 2022 -0700 convert bidders: bliink commit b29945e Author: Demetrio Girardi <[email protected]> Date: Fri May 20 08:21:50 2022 -0700 convert bidders: beachfront commit 97ea0df Author: Demetrio Girardi <[email protected]> Date: Thu May 19 09:21:54 2022 -0700 convert bidders: axonix commit 0f5d97b Author: Demetrio Girardi <[email protected]> Date: Thu May 19 09:01:18 2022 -0700 convert bidders: appnexus commit 2d57f41 Author: Demetrio Girardi <[email protected]> Date: Thu May 19 08:53:30 2022 -0700 convert bidders: apacdex commit 2ef8eaf Author: Demetrio Girardi <[email protected]> Date: Thu May 19 08:46:01 2022 -0700 convert bidders: amx commit fafb541 Author: Demetrio Girardi <[email protected]> Date: Thu May 19 08:36:35 2022 -0700 convert bidders: alkimi commit 113e717 Author: Demetrio Girardi <[email protected]> Date: Wed May 18 13:03:57 2022 -0700 convert bidders: adyoulike commit b9a4d56 Author: Demetrio Girardi <[email protected]> Date: Wed May 18 12:50:19 2022 -0700 convert bidders: adxcg commit 06b0c9d Author: Demetrio Girardi <[email protected]> Date: Wed May 18 12:35:36 2022 -0700 convert bidders: aduptech commit 039444b Author: Demetrio Girardi <[email protected]> Date: Wed May 18 12:23:16 2022 -0700 convert bidders: adrino commit 70305f4 Author: Demetrio Girardi <[email protected]> Date: Wed May 18 12:07:09 2022 -0700 convert bidders: adnuntius commit c614eca Author: Demetrio Girardi <[email protected]> Date: Wed May 18 12:03:30 2022 -0700 convert bidders: adloox commit 43327a9 Author: Demetrio Girardi <[email protected]> Date: Wed May 18 11:55:07 2022 -0700 convert bidders: adkernel commit 0170539 Author: Demetrio Girardi <[email protected]> Date: Wed May 18 11:20:28 2022 -0700 convert bidders: adgeneration commit f849022 Author: Demetrio Girardi <[email protected]> Date: Wed May 18 11:09:30 2022 -0700 convert adapters: adagio commit e861922 Author: Demetrio Girardi <[email protected]> Date: Wed May 18 10:50:25 2022 -0700 rename referer to topmostLocation, make location all-or-nothing commit b31e7cd Author: Demetrio Girardi <[email protected]> Date: Tue May 17 10:42:45 2022 -0700 Updated refererInfo logic * Squashed commit of the following: commit d6d54cab25563e0ebece456d75733c9b9d78175e Author: Demetrio Girardi <[email protected]> Date: Wed May 25 07:40:48 2022 -0700 fix lint commit 43898cdf487b67061e48d65b7c469884df05918a Author: Demetrio Girardi <[email protected]> Date: Wed May 25 07:37:46 2022 -0700 Do not provide a default value for publisherDomain commit 5db64028f42935d2b62f58052562b9ae908c58f8 Author: Demetrio Girardi <[email protected]> Date: Wed May 25 07:33:45 2022 -0700 convert bidders: pass 2 commit a916edbb527f3342abfc2f55485918b08f8c2d30 Author: Demetrio Girardi <[email protected]> Date: Wed May 25 07:09:05 2022 -0700 convert bidders: done! commit 1922bfbf57058b333540f9fef157bb177288dd51 Author: Demetrio Girardi <[email protected]> Date: Wed May 25 06:53:44 2022 -0700 convert bidders: visx commit 31bb9c05044ca911ed683c7f86147ff9475964a1 Merge: dd22a3ddf e524628 Author: Demetrio Girardi <[email protected]> Date: Wed May 25 06:40:54 2022 -0700 Merge branch 'prebid-7' into referer-merge commit e524628 Merge: c885816 14ae8d5 Author: Demetrio Girardi <[email protected]> Date: Wed May 25 06:35:12 2022 -0700 Merge branch 'master' into prebid-7 commit 14ae8d5 Author: Patrick McCann <[email protected]> Date: Tue May 24 15:58:21 2022 -0400 Update fintezaAnalyticsAdapter_spec.js (#8467) commit b01ec40 Author: Prebid.js automated release <[email protected]> Date: Tue May 24 18:40:10 2022 +0000 Increment version to 6.27.0-pre commit e728f54 Author: Prebid.js automated release <[email protected]> Date: Tue May 24 18:40:10 2022 +0000 Prebid 6.26.0 release commit 170f6fd Author: Patrick McCann <[email protected]> Date: Tue May 24 14:23:40 2022 -0400 Revert "Akamai RTD: fixed bugs on rtd module and added the entropy values (#8284)" (#8464) This reverts commit c434889. commit a6e3c44 Author: Demetrio Girardi <[email protected]> Date: Tue May 24 11:21:26 2022 -0700 Remove medianetRtdProvider tests (#8463) commit dd22a3ddf7dd6b01a9adfacada728f9c435cd0b0 Author: Demetrio Girardi <[email protected]> Date: Tue May 24 10:31:14 2022 -0700 convert bidders: unicorn commit de3801d8709e362d0507ee75dd92807734824bbf Author: Demetrio Girardi <[email protected]> Date: Tue May 24 09:17:20 2022 -0700 convert bidders: sovrn commit 063dfb337e67fb8fff98a738e86459ab3851b13e Author: Demetrio Girardi <[email protected]> Date: Tue May 24 08:54:47 2022 -0700 convert bidders: smarthub commit 1a4d03b0fb3c362f3d73a2ac4ee652aa2dba3768 Author: Demetrio Girardi <[email protected]> Date: Tue May 24 08:33:45 2022 -0700 convert bidders: rubicon commit c885816 Author: Nic G <[email protected]> Date: Tue May 24 11:09:27 2022 -0400 Sortable Adapter Removal (#8447) commit f11bcda Author: asurovenko-zeta <[email protected]> Date: Tue May 24 20:51:05 2022 +0700 Zeta global ssp bid adapter: add shortname param (#8454) * zeta_global_sspBidAdapter shortname was added * remove the trash Co-authored-by: Surovenko Alexey <[email protected]> commit c434889 Author: Vikas Srivastava <[email protected]> Date: Tue May 24 19:17:57 2022 +0530 Akamai RTD: fixed bugs on rtd module and added the entropy values (#8284) * Fixed bugs on rtd module and added the entropy values required by Akamai DAP * Fixed the timeout issue in build browserstack tests * Fixing review comments * Fixing review comments - using storage manager for managing localStorage * Fixing review comments - using loadExternalScript method to load the script * Fixed unit test case * Fixing review comments - Added consent handling commit 06ecc38 Author: haruka-yamashita2 <[email protected]> Date: Tue May 24 22:24:00 2022 +0900 Rename id to aoneId from dacId (#8453) * fix lgtm alert * Drop www in enrichments module * make canonicalUrl respect pageUrl consistently * clean up ancient jsdoc on setConfig * test consistency of pageUrl * Update tripleliftBidAdapter.js * Update refererDetection.js * convert bidders: incrx, taboola * Fix minutemedia adapter param name * Update teadsBidAdapter.js * Update rubiconBidAdapter.js
1 parent 759cfc0 commit 6e3f8dd

File tree

376 files changed

+1810
-1906
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

376 files changed

+1810
-1906
lines changed

modules/33acrossBidAdapter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ function _buildRequestParams(bidRequests, bidderRequest) {
195195

196196
const uspConsent = bidderRequest && bidderRequest.uspConsent;
197197

198-
const pageUrl = (bidderRequest && bidderRequest.refererInfo) ? (bidderRequest.refererInfo.referer) : (undefined);
198+
const pageUrl = bidderRequest?.refererInfo?.page
199199

200200
adapterState.uniqueSiteIds = bidRequests.map(req => req.params.siteId).filter(uniques);
201201

modules/a4gBidAdapter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export const spec = {
4444

4545
let data = {
4646
[IFRAME_PARAM_NAME]: 0,
47-
[LOCATION_PARAM_NAME]: (bidderRequest.refererInfo && bidderRequest.refererInfo.referer) ? bidderRequest.refererInfo.referer : window.location.href,
47+
[LOCATION_PARAM_NAME]: bidderRequest.refererInfo?.page,
4848
[SIZE_PARAM_NAME]: sizeParams.join(ARRAY_PARAM_SEPARATOR),
4949
[ID_PARAM_NAME]: idParams.join(ARRAY_PARAM_SEPARATOR),
5050
[ZONE_ID_PARAM_NAME]: zoneIds.join(ARRAY_PARAM_SEPARATOR)

modules/ablidaBidAdapter.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ export const spec = {
4545
sizes: sizes,
4646
bidId: bidRequest.bidId,
4747
categories: bidRequest.params.categories,
48-
referer: bidderRequest.refererInfo.referer,
48+
// TODO: should referer be 'ref'?
49+
referer: bidderRequest.refererInfo.page,
4950
jaySupported: jaySupported,
5051
device: device,
5152
adapterVersion: 5,

modules/adWMGBidAdapter.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ export const spec = {
2727
buildRequests: (validBidRequests, bidderRequest) => {
2828
const timeout = bidderRequest.timeout || 0;
2929
const debug = config.getConfig('debug') || false;
30-
const referrer = bidderRequest.refererInfo.referer;
30+
// TODO: is 'page' the right value here?
31+
const referrer = bidderRequest.refererInfo.page;
3132
const locale = window.navigator.language && window.navigator.language.length > 0 ? window.navigator.language.substr(0, 2) : '';
32-
const domain = config.getConfig('publisherDomain') || (window.location && window.location.host ? window.location.host : '');
33+
const domain = bidderRequest.refererInfo.domain || '';
3334
const ua = window.navigator.userAgent.toLowerCase();
3435
const additional = spec.parseUserAgent(ua);
3536

modules/adagioBidAdapter.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,13 @@ import {
1919
logInfo,
2020
logWarn,
2121
mergeDeep,
22-
parseUrl
2322
} from '../src/utils.js';
2423
import {config} from '../src/config.js';
2524
import {registerBidder} from '../src/adapters/bidderFactory.js';
2625
import {loadExternalScript} from '../src/adloader.js';
2726
import {verify} from 'criteo-direct-rsa-validate/build/verify.js';
2827
import {getStorageManager} from '../src/storageManager.js';
29-
import {getRefererInfo} from '../src/refererDetection.js';
28+
import {getRefererInfo, parseDomain} from '../src/refererDetection.js';
3029
import {createEidsArray} from './userId/eids.js';
3130
import {BANNER, NATIVE, VIDEO} from '../src/mediaTypes.js';
3231
import {Renderer} from '../src/Renderer.js';
@@ -270,12 +269,11 @@ function getDevice() {
270269

271270
function getSite(bidderRequest) {
272271
const { refererInfo } = bidderRequest;
273-
const url = parseUrl(refererInfo.referer);
274-
275272
return {
276-
domain: url.hostname || '',
277-
page: refererInfo.referer || '',
278-
referrer: canAccessTopWindow() ? getWindowTop().document.referrer || '' : getWindowSelf().document.referrer || '',
273+
// TODO: do these fallbacks make sense?
274+
domain: refererInfo.domain || parseDomain(refererInfo.topmostLocation) || '',
275+
page: refererInfo.page || refererInfo.topmostLocation || '',
276+
referrer: refererInfo.ref || getWindowSelf().document.referrer || '',
279277
top: refererInfo.reachedTop
280278
};
281279
};

modules/adbookpspBidAdapter.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,9 @@ function buildRequest(validBidRequests, bidderRequest) {
123123
id: bidderRequest.bidderRequestId,
124124
tmax: bidderRequest.timeout,
125125
site: {
126-
domain: window.location.hostname,
127-
page: window.location.href,
128-
ref: bidderRequest.refererInfo.referer,
126+
domain: bidderRequest.refererInfo.domain,
127+
page: bidderRequest.refererInfo.page,
128+
ref: bidderRequest.refererInfo.ref,
129129
},
130130
source: buildSource(validBidRequests, bidderRequest),
131131
device: buildDevice(),

modules/addefendBidAdapter.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ export const spec = {
2121
pageId: false,
2222
gdpr_applies: bidderRequest.gdprConsent && bidderRequest.gdprConsent.gdprApplies ? bidderRequest.gdprConsent.gdprApplies : 'true',
2323
gdpr_consent: bidderRequest.gdprConsent && bidderRequest.gdprConsent.consentString ? bidderRequest.gdprConsent.consentString : '',
24-
referer: bidderRequest.refererInfo.referer,
24+
// TODO: is 'page' the correct item here?
25+
referer: bidderRequest.refererInfo.page,
2526
bids: [],
2627
};
2728

modules/adfBidAdapter.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
// jshint esversion: 6, es3: false, node: true
22
'use strict';
33

4-
import {
5-
registerBidder
6-
} from '../src/adapters/bidderFactory.js';
7-
import {
8-
NATIVE, BANNER, VIDEO
9-
} from '../src/mediaTypes.js';
10-
import { mergeDeep, _map, deepAccess, parseSizesInput, deepSetValue } from '../src/utils.js';
11-
import { config } from '../src/config.js';
12-
import { Renderer } from '../src/Renderer.js';
4+
import {registerBidder} from '../src/adapters/bidderFactory.js';
5+
import {BANNER, NATIVE, VIDEO} from '../src/mediaTypes.js';
6+
import {_map, deepAccess, deepSetValue, mergeDeep, parseSizesInput} from '../src/utils.js';
7+
import {config} from '../src/config.js';
8+
import {Renderer} from '../src/Renderer.js';
139

1410
const { getConfig } = config;
1511

@@ -81,7 +77,7 @@ export const spec = {
8177
}
8278

8379
if (!site.page) {
84-
site.page = bidderRequest.refererInfo.referer;
80+
site.page = bidderRequest.refererInfo.page;
8581
}
8682
}
8783

modules/adgenerationBidAdapter.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ export const spec = {
4949
if (!validReq.mediaTypes || !validReq.mediaTypes.native) {
5050
data = tryAppendQueryString(data, 'imark', '1');
5151
}
52-
data = tryAppendQueryString(data, 'tp', bidderRequest.refererInfo.referer);
52+
// TODO: is 'page' the right value here?
53+
data = tryAppendQueryString(data, 'tp', bidderRequest.refererInfo.page);
5354
if (isIos()) {
5455
const hyperId = getHyperId(validReq);
5556
if (hyperId != null) {

modules/adhashBidAdapter.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ export const spec = {
103103
const bidRequests = [];
104104
let referrer = '';
105105
if (bidderRequest && bidderRequest.refererInfo) {
106-
referrer = bidderRequest.refererInfo.referer;
106+
// TODO: is 'page' the right value here?
107+
referrer = bidderRequest.refererInfo.page;
107108
}
108109
for (var i = 0; i < validBidRequests.length; i++) {
109110
var index = Math.floor(Math.random() * validBidRequests[i].sizes.length);

modules/adheseBidAdapter.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ export const spec = {
2626

2727
const adheseConfig = config.getConfig('adhese');
2828
const gdprParams = (gdprConsent && gdprConsent.consentString) ? { xt: [gdprConsent.consentString] } : {};
29-
const refererParams = (refererInfo && refererInfo.referer) ? { xf: [base64urlEncode(refererInfo.referer)] } : {};
29+
// TODO: is 'page' the right value here?
30+
const refererParams = (refererInfo && refererInfo.page) ? { xf: [base64urlEncode(refererInfo.page)] } : {};
3031
const globalCustomParams = (adheseConfig && adheseConfig.globalTargets) ? cleanTargets(adheseConfig.globalTargets) : {};
3132
const commonParams = { ...globalCustomParams, ...gdprParams, ...refererParams };
3233
const vastContentAsUrl = !(adheseConfig && adheseConfig.vastContentAsUrl == false);

modules/adkernelAdnAnalyticsAdapter.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,7 @@ export function ExpiringQueue(callback, ttl) {
381381
}
382382
}
383383

384+
// TODO: this should reuse logic from refererDetection
384385
function getNavigationInfo() {
385386
try {
386387
return getLocationAndReferrer(self.top);

modules/adkernelAdnBidAdapter.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { deepAccess, parseSizesInput, isArray, deepSetValue, parseUrl, isStr, isNumber, logInfo } from '../src/utils.js';
1+
import { deepAccess, parseSizesInput, isArray, deepSetValue, isStr, isNumber, logInfo } from '../src/utils.js';
22
import {registerBidder} from '../src/adapters/bidderFactory.js';
33
import {BANNER, VIDEO} from '../src/mediaTypes.js';
44
import {config} from '../src/config.js';
@@ -10,7 +10,7 @@ const DEFAULT_APIS = [1, 2];
1010
const GVLID = 14;
1111

1212
function isRtbDebugEnabled(refInfo) {
13-
return refInfo.referer.indexOf('adk_debug=true') !== -1;
13+
return refInfo.topmostLocation?.indexOf('adk_debug=true') !== -1;
1414
}
1515

1616
function buildImp(bidRequest) {
@@ -83,13 +83,10 @@ function buildRequestParams(tags, bidderRequest) {
8383
}
8484

8585
function buildSite(refInfo) {
86-
let loc = parseUrl(refInfo.referer);
87-
let result = {
88-
page: `${loc.protocol}://${loc.hostname}${loc.pathname}`,
89-
secure: ~~(loc.protocol === 'https')
90-
};
91-
if (self === top && document.referrer) {
92-
result.ref = document.referrer;
86+
const result = {
87+
page: refInfo.page,
88+
secure: ~~(refInfo.page && refInfo.page.startsWith('https')),
89+
ref: refInfo.ref
9390
}
9491
let keywords = document.getElementsByTagName('meta')['keywords'];
9592
if (keywords && keywords.content) {

modules/adkernelBidAdapter.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,14 @@ import {
77
deepSetValue,
88
getAdUnitSizes,
99
getDNT,
10-
inIframe,
1110
isArray,
1211
isArrayOfNums,
1312
isEmpty,
1413
isNumber,
1514
isPlainObject,
1615
isStr,
1716
mergeDeep,
18-
parseGPTSingleSizeArrayToRtbSize,
19-
parseUrl
17+
parseGPTSingleSizeArrayToRtbSize
2018
} from '../src/utils.js';
2119
import {BANNER, NATIVE, VIDEO} from '../src/mediaTypes.js';
2220
import {registerBidder} from '../src/adapters/bidderFactory.js';
@@ -226,7 +224,7 @@ registerBidder(spec);
226224
* @param refererInfo {refererInfo}
227225
*/
228226
function groupImpressionsByHostZone(bidRequests, refererInfo) {
229-
let secure = (refererInfo && refererInfo.referer.indexOf('https:') === 0);
227+
let secure = (refererInfo && refererInfo.page?.indexOf('https:') === 0);
230228
return Object.values(
231229
bidRequests.map(bidRequest => buildImp(bidRequest, secure))
232230
.reduce((acc, curr, index) => {
@@ -535,14 +533,13 @@ function getLanguage() {
535533
* Creates site description object
536534
*/
537535
function createSite(refInfo, fpd) {
538-
let url = parseUrl(refInfo.referer);
539536
let site = {
540-
'domain': url.hostname,
541-
'page': `${url.protocol}://${url.hostname}${url.pathname}`
537+
'domain': refInfo.domain,
538+
'page': refInfo.page
542539
};
543540
mergeDeep(site, fpd.site);
544-
if (!inIframe() && document.referrer) {
545-
site.ref = document.referrer;
541+
if (refInfo.ref != null) {
542+
site.ref = refInfo.ref;
546543
} else {
547544
delete site.ref;
548545
}

modules/adlooxAnalyticsAdapter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ MACRO['creatype'] = function(b, c) {
6161
};
6262
MACRO['pageurl'] = function(b, c) {
6363
const refererInfo = getRefererInfo();
64-
return (refererInfo.canonicalUrl || refererInfo.referer || '').substr(0, 300).split(/[?#]/)[0];
64+
return (refererInfo.page || '').substr(0, 300).split(/[?#]/)[0];
6565
};
6666
MACRO['gpid'] = function(b, c) {
6767
const adUnit = find(auctionManager.getAdUnits(), a => b.adUnitCode === a.code);

modules/adlooxRtdProvider.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ function getBidRequestData(reqBidsConfigObj, callback, config, userConsent) {
304304
[ 'imp', config.params.imps ],
305305
[ 'fc_ip', config.params.freqcap_ip ],
306306
[ 'fc_ipua', config.params.freqcap_ipua ],
307-
[ 'pn', (refererInfo.canonicalUrl || refererInfo.referer || '').substr(0, 300).split(/[?#]/)[0] ]
307+
[ 'pn', (refererInfo.page || '').substr(0, 300).split(/[?#]/)[0] ]
308308
];
309309

310310
if (!adUnits.length) {

modules/admanBidAdapter.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,9 @@ export const spec = {
6565
buildRequests: (validBidRequests = [], bidderRequest) => {
6666
let winTop = window;
6767
let location;
68+
// TODO: this odd try-catch block was copied in several adapters; it doesn't seem to be correct for cross-origin
6869
try {
69-
location = new URL(bidderRequest.refererInfo.referer)
70+
location = new URL(bidderRequest.refererInfo.page)
7071
winTop = window.top;
7172
} catch (e) {
7273
location = winTop.location;

modules/admixerBidAdapter.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ export const spec = {
3939
if (bidderRequest) {
4040
const {bidderCode} = bidderRequest;
4141
endpointUrl = config.getConfig(`${bidderCode}.endpoint_url`);
42-
if (bidderRequest.refererInfo && bidderRequest.refererInfo.referer) {
43-
payload.referrer = encodeURIComponent(bidderRequest.refererInfo.referer);
42+
// TODO: is 'page' the right value here?
43+
if (bidderRequest.refererInfo?.page) {
44+
payload.referrer = encodeURIComponent(bidderRequest.refererInfo.page);
4445
}
4546
if (bidderRequest.gdprConsent) {
4647
payload.gdprConsent = {

modules/adnuntiusBidAdapter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export const spec = {
8181

8282
networks[network] = networks[network] || {};
8383
networks[network].adUnits = networks[network].adUnits || [];
84-
if (bidderRequest && bidderRequest.refererInfo) networks[network].context = bidderRequest.refererInfo.referer;
84+
if (bidderRequest && bidderRequest.refererInfo) networks[network].context = bidderRequest.refererInfo.page;
8585
if (adnMeta) networks[network].metaData = adnMeta;
8686
networks[network].adUnits.push({ ...targeting, auId: bid.params.auId, targetId: bid.bidId });
8787
}

modules/adotBidAdapter.js

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@ import {BANNER, NATIVE, VIDEO} from '../src/mediaTypes.js';
44
import {isArray, isBoolean, isFn, isPlainObject, isStr, logError, replaceAuctionPrice} from '../src/utils.js';
55
import {find} from '../src/polyfill.js';
66
import {config} from '../src/config.js';
7-
import { OUTSTREAM } from '../src/video.js';
7+
import {OUTSTREAM} from '../src/video.js';
88

99
const BIDDER_CODE = 'adot';
1010
const ADAPTER_VERSION = 'v2.0.0';
1111
const BID_METHOD = 'POST';
1212
const BIDDER_URL = 'https://dsp.adotmob.com/headerbidding{PUBLISHER_PATH}/bidrequest';
1313
const REQUIRED_VIDEO_PARAMS = ['mimes', 'protocols'];
14-
const DOMAIN_REGEX = new RegExp('//([^/]*)');
1514
const FIRST_PRICE = 1;
1615
const IMP_BUILDER = { banner: buildBanner, video: buildVideo, native: buildNative };
1716
const NATIVE_PLACEMENTS = {
@@ -43,19 +42,6 @@ function tryParse(data) {
4342
}
4443
}
4544

46-
/**
47-
* Extract domain from given url
48-
*
49-
* @param {string} url
50-
* @returns {string|null} Extracted domain
51-
*/
52-
function extractDomainFromURL(url) {
53-
if (!url || !isStr(url)) return null;
54-
const domain = url.match(DOMAIN_REGEX);
55-
if (isArray(domain) && domain.length === 2) return domain[1];
56-
return null;
57-
}
58-
5945
/**
6046
* Create and return site OpenRtb object from given bidderRequest
6147
*
@@ -65,13 +51,13 @@ function extractDomainFromURL(url) {
6551
function getOpenRTBSiteObject(bidderRequest) {
6652
if (!bidderRequest || !bidderRequest.refererInfo) return null;
6753

68-
const domain = extractDomainFromURL(bidderRequest.refererInfo.referer);
54+
const domain = bidderRequest.refererInfo.domain;
6955
const publisherId = config.getConfig('adot.publisherId');
7056

7157
if (!domain) return null;
7258

7359
return {
74-
page: bidderRequest.refererInfo.referer,
60+
page: bidderRequest.refererInfo.page,
7561
domain: domain,
7662
name: domain,
7763
publisher: {

modules/adpartnerBidAdapter.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,8 @@ export const spec = {
1515
},
1616

1717
buildRequests: function (validBidRequests, bidderRequest) {
18-
let referer = window.location.href;
19-
try {
20-
referer = typeof bidderRequest.refererInfo === 'undefined'
21-
? window.top.location.href
22-
: bidderRequest.refererInfo.referer;
23-
} catch (e) {}
18+
// TODO does it make sense to fall back to window.location.href?
19+
const referer = bidderRequest?.refererInfo?.page || window.location.href;
2420

2521
let bidRequests = [];
2622
let beaconParams = {

modules/adplusBidAdapter.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ function createBidRequest(bid) {
127127
screenWidth: screen.width,
128128
screenHeight: screen.height,
129129
language: window.navigator.language || 'en-US',
130+
// TODO: these should probably look at refererInfo
130131
pageUrl: window.location.href,
131132
domain: window.location.hostname,
132133
referrer: window.location.referrer,

modules/adprimeBidAdapter.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@ export const spec = {
5252
buildRequests: (validBidRequests = [], bidderRequest) => {
5353
let winTop = window;
5454
let location;
55+
// TODO: this odd try-catch block was copied in several adapters; it doesn't seem to be correct for cross-origin
5556
try {
56-
location = new URL(bidderRequest.refererInfo.referer)
57+
location = new URL(bidderRequest.refererInfo.page)
5758
winTop = window.top;
5859
} catch (e) {
5960
location = winTop.location;

modules/adrelevantisBidAdapter.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ export const spec = {
127127

128128
if (bidderRequest && bidderRequest.refererInfo) {
129129
let refererinfo = {
130-
rd_ref: encodeURIComponent(bidderRequest.refererInfo.referer),
130+
// TODO: this sends everything it finds to the backend, except for canonicalUrl
131+
rd_ref: encodeURIComponent(bidderRequest.refererInfo.topmostLocation),
131132
rd_top: bidderRequest.refererInfo.reachedTop,
132133
rd_ifs: bidderRequest.refererInfo.numIframes,
133134
rd_stk: bidderRequest.refererInfo.stack.map((url) => encodeURIComponent(url)).join(',')

modules/adrinoBidAdapter.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ export const spec = {
3030
bidId: validBidRequests[i].bidId,
3131
nativeParams: validBidRequests[i].nativeParams,
3232
placementHash: validBidRequests[i].params.hash,
33-
referer: bidderRequest.refererInfo.referer,
33+
// TODO: is 'page' the right value here?
34+
referer: bidderRequest.refererInfo.page,
3435
userAgent: navigator.userAgent,
3536
}
3637

0 commit comments

Comments
 (0)