Skip to content

Commit

Permalink
GLU-244/OpenX retrieve referrer
Browse files Browse the repository at this point in the history
  • Loading branch information
alexarvanitidismrf committed Mar 22, 2018
1 parent 81393b9 commit 235e3d2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion modules/criteoBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ var CriteoAdapter = function CriteoAdapter() {
var size = (width && height) ? [new Criteo.PubTag.DirectBidding.Size(width, height)]
: null;

var sizes = size || sizes.map((sizeString) => {
sizes = size || sizes.map((sizeString) => {
var xIndex = sizeString.indexOf('x');
var w = parseInt(sizeString.substring(0, xIndex));
var h = parseInt(sizeString.substring(xIndex + 1, sizeString.length))
Expand Down
10 changes: 8 additions & 2 deletions modules/openxBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,10 @@ const OpenxAdapter = function OpenxAdapter() {
}
}

function retrieveReferrer(bids) {
return bids.map(b => b.params.referrer).find(url => !!url);
}

function callBids(params) {
let isIfr;
const bids = params.bids || [];
Expand All @@ -233,9 +237,11 @@ const OpenxAdapter = function OpenxAdapter() {
timeout = params.timeout;
}

const referrer = retrieveReferrer(bids);

buildRequest(bids, {
ju: currentURL,
jr: currentURL,
ju: referrer || currentURL,
jr: referrer || currentURL,
ch: document.charSet || document.characterSet,
res: `${screen.width}x${screen.height}x${screen.colorDepth}`,
ifr: isIfr,
Expand Down

0 comments on commit 235e3d2

Please sign in to comment.