From 31d23ee4a7e5f2e5973a1d59c264d87aeb4b9887 Mon Sep 17 00:00:00 2001 From: marc_tappx Date: Fri, 5 Feb 2021 13:51:38 +0100 Subject: [PATCH] UPDATE: replace the way to get the hostname --- modules/tappxBidAdapter.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/modules/tappxBidAdapter.js b/modules/tappxBidAdapter.js index 30d6275c296..90ece0f3144 100644 --- a/modules/tappxBidAdapter.js +++ b/modules/tappxBidAdapter.js @@ -43,6 +43,7 @@ export const spec = { const TAPPXKEY = getParameters(validBidRequests, 'params.tappxkey'); const BIDFLOOR = getParameters(validBidRequests, 'params.bidfloor'); const bannerMediaType = getParameters(validBidRequests, 'mediaTypes.banner'); + const { refererInfo } = bidderRequest; let requests = []; let payload = {}; @@ -63,11 +64,11 @@ export const spec = { api[0] = getParameters(validBidRequests, 'params.api') ? getParameters(validBidRequests, 'params.api') : [3, 5]; } else { let site = {}; - site.name = window.location.hostname; - site.bundle = window.location.hostname; - site.domain = window.location.hostname; - publisher.name = window.location.hostname; - publisher.domain = window.location.hostname; + site.name = (bidderRequest && refererInfo) ? utils.parseUrl(refererInfo.referer).hostname : window.location.hostname; + site.bundle = (bidderRequest && refererInfo) ? utils.parseUrl(refererInfo.referer).hostname : window.location.hostname; + site.domain = (bidderRequest && refererInfo) ? utils.parseUrl(refererInfo.referer).hostname : window.location.hostname; + publisher.name = (bidderRequest && refererInfo) ? utils.parseUrl(refererInfo.referer).hostname : window.location.hostname; + publisher.domain = (bidderRequest && refererInfo) ? utils.parseUrl(refererInfo.referer).hostname : window.location.hostname; tagid = `${site.name}_typeAdBanVid_${getOs()}`; payload.site = site; }