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 #18 in AOLP_ADS_JS/prebid.js from release/1.0.4 to…
Browse files Browse the repository at this point in the history
… master

* commit 'ed3023c168b26b0067b03852e6d6f77cc00d50be':
  Updated version from rc to to 1.0.4
  Bumped RC version to 1.0.4-rc3
  Fixed server & region options for AOL adapter & analytics
  Fixed typo
  Consolidated default parameter values for ivalid bids in AOL analytics
  • Loading branch information
Samuel Adu committed Aug 26, 2016
2 parents a82b511 + ed3023c commit 90d8ed2
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 15 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
AOL Prebid 1.0.4
----------------
BUGFIX: Fixed default server for AOL adapter & analytics.
BUGFIX: Fixed region option to be picked up by AOL analytics.
BUGFIX: Separate server host names used for AOL adapter & analytics.
BUGFIX: Consolidated default parameter values for invalid bids in AOL analytics.


AOL Prebid 1.0.3
----------------
BUGFIX: Fixed empty hbbid parameter in AOL analytics in case of invalid bid response.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aol-container-tag",
"version": "1.0.3",
"version": "1.0.4",
"description": "AOL Header Bidding Container Tag Library",
"main": "src/prebid.js",
"scripts": {
Expand Down
14 changes: 10 additions & 4 deletions src/adapters/analytics/aol.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ const BID_TIMEOUT = CONSTANTS.EVENTS.BID_TIMEOUT;
const AOL_BIDDER_CODE = 'aol';
const analyticsType = 'endpoint';

const serverMap = {
us: 'hb-us.adtech.advertising.com',
eu: 'hb-eu.adtech.advertising.com',
as: 'hb-as.adtech.advertising.com'
};

const EVENTS = {
AUCTION: 1,
WIN: 2
Expand Down Expand Up @@ -144,7 +150,7 @@ export default utils.extend(adapter({
let aolParams = adUnit.aolParams;
return {
protocol: (document.location.protocol === 'https:') ? 'https' : 'http',
host: this.server || aolParams.server || 'adserver.adtechus.com',
host: this.server || serverMap[aolParams.region] || serverMap.us,
port: aolParams.port || '',
tagversion: '3.0',
network: aolParams.network || '',
Expand All @@ -161,8 +167,8 @@ export default utils.extend(adapter({
return {
pubadid: adUnit.code,
hbauctionid: generateAuctionId(aolParams.placement),
hbwinner: getBidderId(adUnit.winner.bidder),
hbprice: adUnit.winner.cpm || '',
hbwinner: adUnit.winner.bidder ? getBidderId(adUnit.winner.bidder) : 0,
hbprice: adUnit.winner.cpm || 0,
hbcur: '',
pubapi: aolParams.pubapiId
};
Expand All @@ -182,7 +188,7 @@ export default utils.extend(adapter({
getBidderSchema(bid) {
return {
hbbidder: getBidderId(bid.bidder),
hbbid: bid.cpm || '0.0',
hbbid: bid.cpm || 0,
hbstatus: getStatusCode(bid),
hbtime: bid.timeToRespond || ''
};
Expand Down
25 changes: 15 additions & 10 deletions src/adapters/aol.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ var AolAdapter = function AolAdapter() {
};

var serverMap = {
us: 'hb-us.adtech.advertising.com',
eu: 'hb-eu.adtech.advertising.com',
as: 'hb-as.adtech.advertising.com'
us: 'adserver-us.adtech.advertising.com',
eu: 'adserver-eu.adtech.advertising.com',
as: 'adserver-as.adtech.advertising.com'
};

var bids;
Expand Down Expand Up @@ -132,25 +132,30 @@ var AolAdapter = function AolAdapter() {
bidsMap[alias] = bid;

const serverParam = bid.params.server;
const regionParam = bid.params.region;
var regionParam = bid.params.region || 'us';
var server;

if (!serverMap.hasOwnProperty(regionParam)) {
console.warn(`Unknown region '${regionParam}' for AOL bidder.`);
regionParam = 'us'; // Default region.
}

if (serverParam) {
console.warn(
'Server configuration option for AOL bidder is deprecated. ' +
'Please use region (us, eu, ...) instead.'
);
server = serverParam;
} else if (regionParam) {
if (!serverMap.hasOwnProperty(regionParam)) {
console.warn(`Unknown region '${regionParam}' for AOL bidder.`);
}
server = serverMap[bid.params.region];
} else {
server = serverMap[regionParam];
}

// Set region param, used by AOL analytics.
bid.params.region = regionParam;

return {
adContainerId: _dummyUnit(bid.params.adContainerId),
server: server, // By default, DAC.js will use the US region endpoint (adserver.adtechus.com)
server: server,
sizeid: bid.params.sizeId || 0,
pageid: bid.params.pageId || 0,
secure: document.location.protocol === 'https:',
Expand Down

0 comments on commit 90d8ed2

Please sign in to comment.