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

Commit dc9d5af

Browse files
committed
Merge pull request #7 in AOLP_ADS_JS/prebid.js from feature/aol-adapter-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
2 parents 6aba3a7 + 5f5e466 commit dc9d5af

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

src/adapters/aol.js

+10-14
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,11 @@ var adloader = require('../adloader');
66
var AolAdapter = function AolAdapter() {
77

88
// constants
9+
var PUBAPI_VERSION = '2';
910
var ADTECH_BIDDER_NAME = 'aol';
1011
var ADTECH_PUBAPI_CONFIG = {
1112
pixelsDivId: 'pixelsDiv',
1213
defaultKey: 'aolBid',
13-
roundingConfig: [
14-
{
15-
from: 0,
16-
to: 999,
17-
roundFunction: 'tenCentsRound'
18-
}, {
19-
from: 1000,
20-
to: -1,
21-
roundValue: 1000
22-
}
23-
],
2414
pubApiOK: _addBid,
2515
pubApiER: _addErrorBid
2616
};
@@ -70,9 +60,14 @@ var AolAdapter = function AolAdapter() {
7060
return;
7161
}
7262

73-
cpm = response.getCPM();
74-
if (cpm === null || isNaN(cpm)) {
75-
return _addErrorBid(response, context);
63+
var encp = response.data.seatbid[0].bid[0].ext.encp;
64+
if (encp) {
65+
cpm = encp;
66+
} else {
67+
cpm = response.getCPM(context.alias);
68+
if (cpm === null || isNaN(cpm)) {
69+
return _addErrorBid(response, context);
70+
}
7671
}
7772

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

0 commit comments

Comments
 (0)