Skip to content

Commit

Permalink
Criteo adapter handles onSetTargeting and onBidWon (prebid#3276)
Browse files Browse the repository at this point in the history
* Add onBidWon method to bid adapter spec

* Add onSetTargeting method to bid adapter spec

* Update the Criteo adapter to use the new event handlers

* Update Criteo adapter version to 15

* Pass bid to handleSetTargeting
  • Loading branch information
jsfaure authored and Pedro López Jiménez committed Mar 18, 2019
1 parent 0317c73 commit aed33de
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion modules/criteoBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import find from 'core-js/library/fn/array/find';
import JSEncrypt from 'jsencrypt/bin/jsencrypt';
import sha256 from 'crypto-js/sha256';

const ADAPTER_VERSION = 14;
const ADAPTER_VERSION = 15;
const BIDDER_CODE = 'criteo';
const CDB_ENDPOINT = '//bidder.criteo.com/cdb';
const CRITEO_VENDOR_ID = 91;
Expand Down Expand Up @@ -127,6 +127,26 @@ export const spec = {
adapter.handleBidTimeout();
}
},

/**
* @param {Bid} bid
*/
onBidWon: (bid) => {
if (publisherTagAvailable()) {
const adapter = Criteo.PubTag.Adapters.Prebid.GetAdapter(bid.auctionId);
adapter.handleBidWon(bid);
}
},

/**
* @param {Bid} bid
*/
onSetTargeting: (bid) => {
if (publisherTagAvailable()) {
const adapter = Criteo.PubTag.Adapters.Prebid.GetAdapter(bid.auctionId);
adapter.handleSetTargeting(bid);
}
},
};

/**
Expand Down

0 comments on commit aed33de

Please sign in to comment.