Skip to content

Commit

Permalink
Add network zone matching to criteo adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugo Duthil committed Jul 13, 2017
1 parent d0b73f4 commit fc89cf4
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions modules/criteoBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var CriteoAdapter = function CriteoAdapter() {
_pushBidRequestEvent(params);
adloader.loadScript(
_publisherTagUrl,
function () {},
function () { },
true
);
} else {
Expand All @@ -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;
}

Expand All @@ -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
Expand Down

0 comments on commit fc89cf4

Please sign in to comment.