From fc89cf411333ca16f392d603e91fef263c9c7437 Mon Sep 17 00:00:00 2001 From: Hugo Duthil Date: Wed, 21 Jun 2017 19:02:56 +0200 Subject: [PATCH] Add network zone matching to criteo adapter --- modules/criteoBidAdapter.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/modules/criteoBidAdapter.js b/modules/criteoBidAdapter.js index c380a2885f9..7a83ad9ff29 100644 --- a/modules/criteoBidAdapter.js +++ b/modules/criteoBidAdapter.js @@ -16,7 +16,7 @@ var CriteoAdapter = function CriteoAdapter() { _pushBidRequestEvent(params); adloader.loadScript( _publisherTagUrl, - function () {}, + function () { }, true ); } else { @@ -42,15 +42,22 @@ var CriteoAdapter = function CriteoAdapter() { // build slots before sending one multi-slots bid request for (var i = 0; i < bids.length; i++) { var bid = bids[i]; + var sizes = bid.sizes || []; slots.push( new Criteo.PubTag.DirectBidding.DirectBiddingSlot( bid.placementCode, bid.params.zoneId, undefined, - bid.transactionId + bid.transactionId, + sizes.map((size) => { + return { width: size[0], height: size[1] } + } + ) ) ); + var networkid = bid.params.networkId; + isAudit |= bid.params.audit !== undefined; } @@ -60,7 +67,9 @@ var CriteoAdapter = function CriteoAdapter() { slots, _callbackSuccess(slots), _callbackError(slots), - _callbackError(slots) // timeout handled as error + _callbackError(slots), // timeout handled as error + undefined, + networkid ); // process the event as soon as possible