Skip to content

Commit

Permalink
Merge pull request #4 from Marfeel/OpenXRetrieveReferrer
Browse files Browse the repository at this point in the history
GLU-244/OpenX retrieve referrer
  • Loading branch information
alexarvanitidismrf authored Mar 23, 2018
2 parents 81393b9 + 235e3d2 commit 82688f9
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 82688f9

Please sign in to comment.