diff --git a/_includes/example_code.html b/_includes/example_code.html deleted file mode 100644 index e7d1aba6b0..0000000000 --- a/_includes/example_code.html +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - -
- -
- -
- -
- - \ No newline at end of file diff --git a/_layouts/example.html b/_layouts/example.html index d0eb379a39..014f6d78cb 100644 --- a/_layouts/example.html +++ b/_layouts/example.html @@ -83,11 +83,6 @@

Other examples:

- diff --git a/assets/js/pbjs-draw-log-diagram.js b/assets/js/pbjs-draw-log-diagram.js index 3ac0d118f8..fe821b4c53 100644 --- a/assets/js/pbjs-draw-log-diagram.js +++ b/assets/js/pbjs-draw-log-diagram.js @@ -40,6 +40,39 @@ function createBar(eventData, isBid) { return [eventName, startTime, duration, tooltip, style, annotation]; } +function logToParse(logs) { + for (eventCode in logs) { + + if (eventCode == 'bids') { + var bidEvents = logs[eventCode]; + for (var i in bidEvents) { + var bidEvent = bidEvents[i]; + + var latency = bidEvent['end'] - bidEvent['start']; + var cpm = bidEvent['cpm']; + var bidderCode = bidEvent['bidderCode']; + + var CPMobj = Parse.Object.extend("demoCPM"); + var cpmObj = new CPMobj(); + cpmObj.set("bidderCode", bidderCode); + cpmObj.set("cpm", cpm); + cpmObj.set("loadTime", latency); + + cpmObj.save(null, { + success: function(visitor) { + console.log('added to parse') + }, + error: function(visitor, error) { + // Show the error message somewhere and let the user try again. + console.log('failed at adding to parse'); + } + }); + + } + } + } +} + // logs = {"Load Prebid.js":{"static":true,"start":0,"end":4},"Adserver Timer":{"static":true,"start":0,"end":619},"amazon":{"start":134,"end":618,"cpm":0},"appnexus":{"start":132,"end":519,"cpm":0.5},"criteo":{"start":152,"end":519,"cpm":0},"openx":{"start":153,"end":1349},"pubmatic":{"start":135,"end":1059},"rubicon":{"start":154,"end":734,"cpm":3.813333},"Load GPT":{"static":true,"start":619,"end":813},"Set Targeting":{"static":true,"start":816,"end":842}}; //finalEndTime = 1500; @@ -115,4 +148,5 @@ window.drawLog = function(logs, finalEndTime) { var chart = new google.visualization.BarChart(document.getElementById('chart_div')); chart.draw(dataTable, options); + logToParse(logs); } \ No newline at end of file diff --git a/assets/js/pbjs-event-logger.js b/assets/js/pbjs-event-logger.js index c9f1f4b8cf..30ea9b9597 100644 --- a/assets/js/pbjs-event-logger.js +++ b/assets/js/pbjs-event-logger.js @@ -45,6 +45,8 @@ eventLogger.logBidsLatency = function() { bidEvent['end'] = bid.responseTimestamp - initTime; bidEvent['cpm'] = bid.cpm; + bidEvent['bidderCode'] = bid.bidderCode; + pbjsLog.bids.push(bidEvent); } }); diff --git a/dev-docs/.DS_Store b/dev-docs/.DS_Store index ccf92f709f..515d90bba7 100644 Binary files a/dev-docs/.DS_Store and b/dev-docs/.DS_Store differ diff --git a/examples/pbjs_demo.html b/examples/pbjs_demo.html index 35a17f43f1..b734e9e338 100644 --- a/examples/pbjs_demo.html +++ b/examples/pbjs_demo.html @@ -78,11 +78,9 @@ { bidder: 'appnexus', params: { - placementId: '4799418', - "referrer":"rolando.com", - "alt_referrer":"rolando.com" + placementId: '4799418' } - }, + },/* // 1 ad unit can also be targeted by multiple bids from 1 bidder { bidder: 'appnexus', @@ -132,6 +130,50 @@ adSlot: 'TO ADD' } }*/ + { + bidder: 'pubmatic', + params: { + publisherId: 39741, + adSlot: '39620189@300x250' + } + }, /*{ + bidder: 'pubmatic', + params: { + publisherId: 39741, + adSlot: '39620189@300x600' + } + },*/ + { + bidder: 'criteo', + params: { + nid: "2612", + cookiename: "cto_test" + } + },{ + bidder: 'rubicon', + params: { + rp_account : '9707', + rp_site: '17955', + rp_zonesize : '50983-15', + rp_tracking : 'affiliate-1701207318', + rp_floor : '0.1' + } + },{ + bidder: 'casale', + params: { + slotId: '1', + casaleUrl: 'http://js.indexww.com/ht/elitedaily.js' + } + }, + { + bidder: 'openx', + params: { + unit: '537986875', + pageURL : 'http://elitedaily.com', + refererURL : 'http://elitedaily.com', + jstag_url : 'http://ox-d.elitedaily.servedbyopenx.com/w/1.0/jstag?nc=5765-elite_daily' + } + } ] }];