From f38a1dbae1d3d3e64af4fe1bfc420ed17af6de84 Mon Sep 17 00:00:00 2001 From: westerschmal <30859973+westerschmal@users.noreply.github.com> Date: Thu, 24 Sep 2020 16:53:49 +0200 Subject: [PATCH] get target from url for debugging --- modules/adheseBidAdapter.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/adheseBidAdapter.js b/modules/adheseBidAdapter.js index 606e56c13d5..80e34f5d7d9 100644 --- a/modules/adheseBidAdapter.js +++ b/modules/adheseBidAdapter.js @@ -27,10 +27,11 @@ export const spec = { const refererParams = (refererInfo && refererInfo.referer) ? { xf: [base64urlEncode(refererInfo.referer)] } : {}; const id5Params = (getId5Id(validBidRequests)) ? { x5: [getId5Id(validBidRequests)] } : {}; const slots = validBidRequests.map(bid => ({ slotname: bidToSlotName(bid) })); + const debugParam = getDebugParam() ? { in: [getDebugParam()] } : {}; const payload = { slots: slots, - parameters: { ...targets, ...gdprParams, ...refererParams, ...id5Params } + parameters: { ...targets, ...gdprParams, ...refererParams, ...id5Params, ...debugParam } } const account = getAccount(validBidRequests); @@ -221,4 +222,9 @@ function base64urlEncode(s) { return btoa(s).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, ''); } +function getDebugParam() { + const urlParams = new URLSearchParams(window.location.search); + return urlParams.get('adheseDebug'); +} + registerBidder(spec);