Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get target from url for debugging #3

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion modules/adheseBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);