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

RPO-2858: Update Concert prebid adapter to pass along top-line page referer #4

Merged
merged 3 commits into from
Jun 15, 2022
Merged
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
20 changes: 10 additions & 10 deletions modules/concertBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { logWarn, logMessage, debugTurnedOn, generateUUID } from '../src/utils.js';
import { registerBidder } from '../src/adapters/bidderFactory.js';
import { getStorageManager } from '../src/storageManager.js'
import { getStorageManager } from '../src/storageManager.js';

const BIDDER_CODE = 'concert';
const CONCERT_ENDPOINT = 'https://bids.concert.io';
Expand Down Expand Up @@ -45,7 +45,7 @@ export const spec = {
uspConsent: bidderRequest.uspConsent,
gdprConsent: bidderRequest.gdprConsent
}
}
};

payload.slots = validBidRequests.map(bidRequest => {
let slot = {
Expand All @@ -57,8 +57,9 @@ export const spec = {
slotType: bidRequest.params.slotType,
adSlot: bidRequest.params.slot || bidRequest.adUnitCode,
placementId: bidRequest.params.placementId || '',
site: bidRequest.params.site || bidderRequest.refererInfo.page
}
site: bidRequest.params.site || bidderRequest.refererInfo.page,
ref: bidderRequest.refererInfo.ref || window.document.referrer
};

return slot;
});
Expand All @@ -69,7 +70,7 @@ export const spec = {
method: 'POST',
url: `${CONCERT_ENDPOINT}/bids/prebid`,
data: JSON.stringify(payload)
}
};
},
/**
* Unpack the response from the server into a list of bids.
Expand Down Expand Up @@ -101,7 +102,7 @@ export const spec = {
creativeId: bid.creativeId,
netRevenue: bid.netRevenue,
currency: bid.currency
}
};
});

if (debugTurnedOn() && serverBody.debug) {
Expand All @@ -122,7 +123,7 @@ export const spec = {
* @return {UserSync[]} The user syncs which should be dropped.
*/
getUserSyncs: function(syncOptions, serverResponses, gdprConsent, uspConsent) {
const syncs = []
const syncs = [];
if (syncOptions.iframeEnabled && !hasOptedOutOfPersonalization()) {
let params = [];

Expand Down Expand Up @@ -161,8 +162,7 @@ export const spec = {
logMessage('concert bidder won bid');
logMessage(bid);
}

}
};

registerBidder(spec);

Expand Down Expand Up @@ -207,5 +207,5 @@ function consentAllowsPpid(bidderRequest) {
* `consent-string` npm module; so will have to rely on that
* happening on the bid-server. */
return !(bidderRequest.uspConsent === 'string' &&
bidderRequest.uspConsent.toUpperCase().substring(0, 2) === '1YY')
bidderRequest.uspConsent.toUpperCase().substring(0, 2) === '1YY');
}