diff --git a/integrationExamples/gpt/pbjs_example_gpt.html b/integrationExamples/gpt/pbjs_example_gpt.html index 6e192a7ad66..9b42f75405f 100644 --- a/integrationExamples/gpt/pbjs_example_gpt.html +++ b/integrationExamples/gpt/pbjs_example_gpt.html @@ -38,7 +38,7 @@ (function() { var d = document, pbs = d.createElement("script"), pro = d.location.protocal; pbs.type = "text/javascript"; - pbs.src = '/build/dist/prebid.js'; + pbs.src = '/build/dist/prebid.js'; var target = document.getElementsByTagName("head")[0]; target.insertBefore(pbs, target.firstChild); })(); @@ -80,12 +80,6 @@ publisherId: 'TO ADD', adSlot: 'TO ADD@300x600' } - }, { - bidder: 'criteo', - params: { - nid: "TO ADD", - cookiename: "cto_test" - } }, { bidder: 'yieldbot', params: { diff --git a/integrationExamples/gpt/pbjs_partial_refresh_gpt.html b/integrationExamples/gpt/pbjs_partial_refresh_gpt.html index 1cf631e640c..4830adddae1 100644 --- a/integrationExamples/gpt/pbjs_partial_refresh_gpt.html +++ b/integrationExamples/gpt/pbjs_partial_refresh_gpt.html @@ -82,12 +82,6 @@ publisherId: 'TO ADD', adSlot: 'TO ADD@300x600' } - }, { - bidder: 'criteo', - params: { - nid: "TO ADD", - cookiename: "cto_test" - } }] },{ code: '/9968336/header-bid-tag1', diff --git a/src/adaptermanager.js b/src/adaptermanager.js index 54fd6229ba8..4038fce81f2 100644 --- a/src/adaptermanager.js +++ b/src/adaptermanager.js @@ -5,7 +5,6 @@ var AppNexusAdapter = require('./adapters/appnexus.js'); var AolAdapter = require('./adapters/aol'); var OpenxAdapter = require('./adapters/openx'); var PubmaticAdapter = require('./adapters/pubmatic.js'); -var CriteoAdapter = require('./adapters/criteo'); var YieldbotAdapter = require('./adapters/yieldbot'); var IndexExchange = require('./adapters/indexExchange'); var Sovrn = require('./adapters/sovrn'); @@ -93,7 +92,6 @@ this.registerBidAdapter(RubiconAdapter(), 'rubicon'); this.registerBidAdapter(AppNexusAdapter.createNew(), 'appnexus'); this.registerBidAdapter(OpenxAdapter(), 'openx'); this.registerBidAdapter(PubmaticAdapter(), 'pubmatic'); -this.registerBidAdapter(CriteoAdapter(), 'criteo'); this.registerBidAdapter(YieldbotAdapter(), 'yieldbot'); this.registerBidAdapter(IndexExchange(), 'indexExchange'); this.registerBidAdapter(Sovrn(),'sovrn'); diff --git a/src/adapters/criteo.js b/src/adapters/criteo.js deleted file mode 100644 index 5da825396f7..00000000000 --- a/src/adapters/criteo.js +++ /dev/null @@ -1,74 +0,0 @@ -var CONSTANTS = require('../constants.json'); -var utils = require('../utils.js'); -var bidfactory = require('../bidfactory.js'); -var bidmanager = require('../bidmanager.js'); -var adloader = require('../adloader'); - -/** - * Adapter for requesting bids from Criteo. - * - * @returns {{callBids: _callBids}} - * @constructor - */ -var CriteoAdapter = function CriteoAdapter() { - var bids; - - function _callBids(params) { - bids = params.bids || []; - - // Only make one request per "nid" - _getUniqueNids(bids).forEach(_requestBid); - } - - function _getUniqueNids(bids) { - var key; - var map = {}; - var nids = []; - bids.forEach(function(bid) { - map[bid.params.nid] = bid; - }); - for (key in map) { - if (map.hasOwnProperty(key)) { - nids.push(map[key]); - } - } - return nids; - } - - function _requestBid(bid) { - var varname = bid.params.varname; - var scriptUrl = '//rtax.criteo.com/delivery/rta/rta.js?netId=' + encodeURI(bid.params.nid) + - '&cookieName=' + encodeURI(bid.params.cookiename) + - '&rnd=' + Math.floor(Math.random() * 99999999999) + - '&varName=' + encodeURI(varname); - - adloader.loadScript(scriptUrl, function(response) { - var adResponse; - var content = window[varname]; - - // Add a response for each bid matching the "nid" - bids.forEach(function(existingBid) { - if (existingBid.params.nid === bid.params.nid) { - if (content) { - adResponse = bidfactory.createBid(1); - adResponse.bidderCode = 'criteo'; - - adResponse.keys = content.replace(/\;$/, '').split(';'); - } else { - // Indicate an ad was not returned - adResponse = bidfactory.createBid(2); - adResponse.bidderCode = 'criteo'; - } - - bidmanager.addBidResponse(existingBid.placementCode, adResponse); - } - }); - }); - } - - return { - callBids: _callBids - }; -}; - -module.exports = CriteoAdapter;