Skip to content
This repository has been archived by the owner on Feb 13, 2021. It is now read-only.

Commit

Permalink
Merge pull request #7 in AOLP_ADS_JS/prebid.js from feature/aol-adapt…
Browse files Browse the repository at this point in the history
…er-v2-endpoint to master

* commit '5f5e46697eed5b16571cdd0407fc2578b450ea78':
  Fixed AOL PubAPI version to be string
  Reverted AOL adapter to use decimal CPM
  Updated AOL adapter to use v2 server endpoint
  • Loading branch information
marian-r committed Aug 16, 2016
2 parents 6aba3a7 + 5f5e466 commit dc9d5af
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions src/adapters/aol.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,11 @@ var adloader = require('../adloader');
var AolAdapter = function AolAdapter() {

// constants
var PUBAPI_VERSION = '2';
var ADTECH_BIDDER_NAME = 'aol';
var ADTECH_PUBAPI_CONFIG = {
pixelsDivId: 'pixelsDiv',
defaultKey: 'aolBid',
roundingConfig: [
{
from: 0,
to: 999,
roundFunction: 'tenCentsRound'
}, {
from: 1000,
to: -1,
roundValue: 1000
}
],
pubApiOK: _addBid,
pubApiER: _addErrorBid
};
Expand Down Expand Up @@ -70,9 +60,14 @@ var AolAdapter = function AolAdapter() {
return;
}

cpm = response.getCPM();
if (cpm === null || isNaN(cpm)) {
return _addErrorBid(response, context);
var encp = response.data.seatbid[0].bid[0].ext.encp;
if (encp) {
cpm = encp;
} else {
cpm = response.getCPM(context.alias);
if (cpm === null || isNaN(cpm)) {
return _addErrorBid(response, context);
}
}

// clean up--we no longer need to store the bid
Expand Down Expand Up @@ -162,6 +157,7 @@ var AolAdapter = function AolAdapter() {
size: bid.params.size || (bid.sizes || [])[0]
},
params: {
v: PUBAPI_VERSION,
cors: 'yes',
cmd: 'bid',
bidfloor: (typeof bid.params.bidFloor !== "undefined") ? bid.params.bidFloor.toString() : ''
Expand Down

0 comments on commit dc9d5af

Please sign in to comment.