Skip to content

Commit c614eca

Browse files
committed
convert bidders: adloox
1 parent 43327a9 commit c614eca

File tree

5 files changed

+10
-11
lines changed

5 files changed

+10
-11
lines changed

modules/adkernelBidAdapter.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ registerBidder(spec);
226226
* @param refererInfo {refererInfo}
227227
*/
228228
function groupImpressionsByHostZone(bidRequests, refererInfo) {
229-
let secure = (refererInfo && refererInfo.referer.indexOf('https:') === 0);
229+
let secure = (refererInfo && refererInfo.page?.indexOf('https:') === 0);
230230
return Object.values(
231231
bidRequests.map(bidRequest => buildImp(bidRequest, secure))
232232
.reduce((acc, curr, index) => {
@@ -535,14 +535,13 @@ function getLanguage() {
535535
* Creates site description object
536536
*/
537537
function createSite(refInfo, fpd) {
538-
let url = parseUrl(refInfo.referer);
539538
let site = {
540-
'domain': url.hostname,
541-
'page': `${url.protocol}://${url.hostname}${url.pathname}`
539+
'domain': refInfo.domain,
540+
'page': refInfo.page
542541
};
543542
mergeDeep(site, fpd.site);
544-
if (!inIframe() && document.referrer) {
545-
site.ref = document.referrer;
543+
if (refInfo.ref != null) {
544+
site.ref = refInfo.ref;
546545
} else {
547546
delete site.ref;
548547
}

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['pbadslot'] = 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
@@ -306,7 +306,7 @@ function getBidRequestData(reqBidsConfigObj, callback, config, userConsent) {
306306
[ 'imp', config.params.imps ],
307307
[ 'fc_ip', config.params.freqcap_ip ],
308308
[ 'fc_ipua', config.params.freqcap_ipua ],
309-
[ 'pn', (refererInfo.canonicalUrl || refererInfo.referer || '').substr(0, 300).split(/[?#]/)[0] ]
309+
[ 'pn', (refererInfo.page || '').substr(0, 300).split(/[?#]/)[0] ]
310310
];
311311

312312
if (!adUnits.length) {

src/refererDetection.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,7 @@ export function detectReferer(win) {
251251
* @property {string|null} page the best candidate for the current page URL: `canonicalUrl`, falling back to `location`
252252
* @property {string|null} domain the domain portion of `page`
253253
* @property {string|null} the referrer (document.referrer) to the current page, or null if not available (due to cross-origin restricitons)
254-
* @property {string} topmostLocation of the top-most frame for which we could guess the location. Outside of cross-origin scenarios, this is
255-
* equivalent to `location`.
254+
* @property {string} topmostLocation of the top-most frame for which we could guess the location. Outside of cross-origin scenarios, this is equivalent to `location`.
256255
* @property {number} numIframes number of steps between window.self and window.top
257256
* @property {Array[string|null]} stack our best guess at the location for each frame, in the direction top -> self.
258257
*/

test/spec/modules/adkernelBidAdapter_spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {spec} from 'modules/adkernelBidAdapter';
33
import * as utils from 'src/utils';
44
import {NATIVE, BANNER, VIDEO} from 'src/mediaTypes';
55
import {config} from 'src/config';
6+
import {parseDomain} from '../../../src/refererDetection.js';
67

78
describe('Adkernel adapter', function () {
89
const bid1_zone1 = {
@@ -253,7 +254,7 @@ describe('Adkernel adapter', function () {
253254
});
254255

255256
function buildBidderRequest(url = 'https://example.com/index.html', params = {}) {
256-
return Object.assign({}, params, {refererInfo: {referer: url, reachedTop: true}, timeout: 3000, bidderCode: 'adkernel'});
257+
return Object.assign({}, params, {refererInfo: {page: url, domain: parseDomain(url), reachedTop: true}, timeout: 3000, bidderCode: 'adkernel'});
257258
}
258259
const DEFAULT_BIDDER_REQUEST = buildBidderRequest();
259260

0 commit comments

Comments
 (0)