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

* commit '5109273bd4317535b23e26ff609345101a3d038d': (49 commits)
  Disable unit tests that fails on PhantomJs.
  Fixed unit tests for adapter loader.
  Changed way of including analytic adapters.
  Added adapters in aolPartnersIds.json.
  Added changelog entry.
  Replace removed utils.extend functionality by object.assign.
  Add Inneractive adapter (prebid#1048)
  Add alias freewheel-ssp to stickyadstv bidder adapter  (prebid#1043)
  Add Facebook Audience Network adapter (prebid#1068)
  Add Atomx support (prebid#1056)
  Updated rubicon video bid endpoint in source and test files (prebid#1097)
  Pass through params to server (prebid#1084)
  Reset the list of slots to be requested between each action for pubmatic (prebid#1079)
  Support for downloading Analytics Adapters via http://prebid.org/download.html (prebid#1021)
  update PR template to include link to dev docs page (prebid#1075)
  Prebid 0.21.0
  Lifestreet adapter: ignore unnecessary events from creative. (prebid#1054)
  Video header bidding support to RhythmOne bidder adapter (prebid#1052)
  Add rubicon targeting to rubicon bid responses for bidderSettings use (prebid#1045)
  Fix adapter getSize (prebid#1064)
  ...
  • Loading branch information
vzhukovsky committed May 19, 2017
2 parents 67f20dd + 5109273 commit ab3f32e
Show file tree
Hide file tree
Showing 71 changed files with 2,735 additions and 518 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Thank you for your pull request. Please make sure this PR is scoped to one chang
<!-- Remove items that don't apply and/or select an item by changing [ ] to [x] -->
- [ ] Bugfix
- [ ] Feature
- [ ] New bidder adapter
- [ ] New bidder adapter <!-- IMPORTANT: if checking here, also submit your bidder params documentation here https://github.com/prebid/prebid.github.io/tree/master/dev-docs/bidders -->
- [ ] Code style update (formatting, local variables)
- [ ] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
AOL Prebid 1.19.0
----------------
Updated to Prebid 0.21.0


AOL Prebid 1.18.0
----------------
Updated to Prebid 0.20.0
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ This URL is designed specifically for the Container Tag library and it supports
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/prebid/Prebid.js.svg)](http://isitmaintained.com/project/prebid/Prebid.js "Average time to resolve an issue")
[![Code Climate](https://codeclimate.com/github/prebid/Prebid.js/badges/gpa.svg)](https://codeclimate.com/github/prebid/Prebid.js)
[![Coverage Status](https://coveralls.io/repos/github/prebid/Prebid.js/badge.svg)](https://coveralls.io/github/prebid/Prebid.js)
[![devDependencies Status](https://david-dm.org/prebid/Prebid.js/dev-status.svg)](https://david-dm.org/prebid/Prebid.js?type=dev)

# Prebid.js

Expand Down Expand Up @@ -181,6 +182,8 @@ Many SSPs, bidders, and publishers have contributed to this project. [20+ Bidder

To add a bidder adapter, see the instructions in [How to add a bidder adaptor](http://prebid.org/dev-docs/bidder-adaptor.html).

Please **do NOT load Prebid.js inside your adapter**. If you do this, we will reject or remove your adapter as appropriate.

### Code Quality

Code quality is defined by `.jscs` and `.jshint` files and errors are reported in the terminal.
Expand Down
24 changes: 22 additions & 2 deletions adapters.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"adform",
"adkernel",
"admedia",
"bidfluence",
"vertamedia",
"aol",
"appnexus",
Expand All @@ -20,18 +21,21 @@
"indexExchange",
"kruxlink",
"getintent",
"inneractive",
"komoona",
"lifestreet",
"mantis",
"openx",
"piximedia",
"pubmatic",
"pulsepoint",
"pulsepointLite",
"rhythmone",
"rubicon",
"smartyads",
"smartadserver",
"smartadserver",
"sekindoUM",
"serverbid",
"sonobi",
"sovrn",
"springserve",
Expand All @@ -54,6 +58,8 @@
"vertoz",
"widespace",
"admixer",
"atomx",
"tapsense",
{
"appnexus": {
"alias": "brealtime"
Expand All @@ -69,6 +75,11 @@
"alias": "defymedia"
}
},
{
"appnexus": {
"alias": "gourmetads"
}
},
{
"appnexusAst": {
"supportedMediaTypes": ["video"]
Expand Down Expand Up @@ -108,6 +119,15 @@
"getintent": {
"supportedMediaTypes" : ["video"]
}
},
{
"stickyadstv": {
"alias": "freewheel-ssp"
}
},
{
"rhythmone": {
"supportedMediaTypes": ["video"]
}
}

]
1 change: 1 addition & 0 deletions analytics.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["aol"]
6 changes: 6 additions & 0 deletions integrationExamples/gpt/pbjs_example_gpt.html
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,12 @@
params: {
zone: '2eb6bd58-865c-47ce-af7f-a918108c3fd2' // REQUIRED zone oid
}
},
{
bidder: 'atomx',
params: {
id: 7395
}
}
]
}, {
Expand Down
2 changes: 1 addition & 1 deletion integrationExamples/gpt/x-domain/creative.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
var urlParser = document.createElement('a');
urlParser.href = '%%PATTERN:url%%';
var publisherDomain = urlParser.protocol + '//' + urlParser.hostname;
var adServerDomain = 'https://tpc.googlesyndication.com';
var adServerDomain = urlParser.protocol + '//tpc.googlesyndication.com';

function renderAd(ev) {
var key = ev.message ? 'message' : 'data';
Expand Down
3 changes: 2 additions & 1 deletion karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ module.exports = function (config) {

// list of files to exclude
exclude: [
'test/spec/loaders/**/*.js'
'test/spec/loaders/**/*.js',
'test/spec/adapters/underdogmedia_spec.js'
],

// preprocess matching files before serving them to the browser
Expand Down
9 changes: 1 addition & 8 deletions loaders/adapterLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const fs = require('fs');
const blockLoader = require('block-loader');
const getAdapters = require('./getAdapters');

const adapters = getAdapters();
const adapters = getAdapters('adapters.json', 'adapters');
const files = fs.readdirSync('src/adapters').map((file) => file.replace(/\.[^/.]+$/, ''));
const adapterNames = adapters.filter(getStandardAdapters).filter(getUniques);
//adapters loaded from `srcPath`
Expand Down Expand Up @@ -46,13 +46,6 @@ function insertAdapters() {
}
});


if (!inserts.length) {
console.log('Prebid Warning: no matching adapters found for config, no adapters will be' +
' loaded.');
return '';
}

return '/*!ADAPTER REGISTER DELIMITER*/' + inserts.map(name => {

return `var ${adapterName(name)} = require('./adapters/${name}.js');
Expand Down
3 changes: 2 additions & 1 deletion loaders/analyticsLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

const fs = require('fs');
const blockLoader = require('block-loader');
let analyticsAdapters = require('../package.json').analytics;
const getAdapters = require('./getAdapters');
let analyticsAdapters = getAdapters('analytics.json', 'analyticsAdapters');

var options = {
start: '/** INSERT ANALYTICS - DO NOT EDIT OR REMOVE */',
Expand Down
8 changes: 3 additions & 5 deletions loaders/getAdapters.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ const fs = require('fs');
const path = require('path');
const argv = require('yargs').argv;

const defaultAdapters = 'adapters.json';

function load(file) {
try {
const buffer = fs.readFileSync(file);
Expand All @@ -15,8 +13,8 @@ function load(file) {
}
}

module.exports = function getAdapters() {
let customAdapters = argv.adapters;
module.exports = function getAdapters(defaultAdapters, argName) {
let customAdapters = argv[argName];

if (!customAdapters) {
return load(defaultAdapters);
Expand All @@ -29,7 +27,7 @@ module.exports = function getAdapters() {
return load(customAdapters);
} catch (e) {
console.log(`Prebid Warning: custom adapters config cannot be loaded from ${customAdapters}, ` +
'using default adapters.json');
`using default ${defaultAdapters}`);
return load(defaultAdapters);
}
};
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "prebid.js",
"version": "0.20.0",
"version": "0.21.0",
"description": "Header Bidding Management Library",
"main": "src/prebid.js",
"scripts": {
Expand All @@ -17,7 +17,6 @@
"prebid"
],
"globalVarName": "pbjs",
"analytics": ["aol"],
"author": "the prebid.js contributors",
"contributors": [{
"name": "AOL Platforms",
Expand Down Expand Up @@ -95,7 +94,7 @@
"requirejs": "^2.1.20",
"sinon": "^1.12.1",
"string-replace-webpack-plugin": "0.0.3",
"uglify-js": "^2.4.15",
"uglify-js": "^2.8.10",
"url-parse": "^1.0.5",
"webpack": "^1.12.3",
"webpack-stream": "^3.1.0",
Expand Down
1 change: 1 addition & 0 deletions src/adaptermanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ function getBids({bidderCode, requestId, bidderRequestId, adUnits}) {
return Object.assign({}, bid, {
placementCode: adUnit.code,
mediaType: adUnit.mediaType,
transactionId : adUnit.transactionId,
sizes: sizes,
bidId: utils.getUniqueIdentifierStr(),
bidderRequestId,
Expand Down
7 changes: 4 additions & 3 deletions src/adapters/adkernel.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ const AdKernelAdapter = function AdKernelAdapter() {
try {
document.body.appendChild(iframe);
} catch (error) {
/* istanbul ignore next */
utils.logError(error);
}
}
Expand Down Expand Up @@ -176,7 +177,7 @@ const AdKernelAdapter = function AdKernelAdapter() {
* Create bid object for the bid manager
*/
function createBidObject(resp, bid, width, height) {
return utils.extend(bidfactory.createBid(1, bid), {
return Object.assign(bidfactory.createBid(1, bid), {
bidderCode: bid.bidder,
ad: formatAdMarkup(resp),
width: width,
Expand All @@ -189,7 +190,7 @@ const AdKernelAdapter = function AdKernelAdapter() {
* Create empty bid object for the bid manager
*/
function createEmptyBidObject(bid) {
return utils.extend(bidfactory.createBid(2, bid), {
return Object.assign(bidfactory.createBid(2, bid), {
bidderCode: bid.bidder
});
}
Expand All @@ -200,7 +201,7 @@ const AdKernelAdapter = function AdKernelAdapter() {
function formatAdMarkup(bid) {
var adm = bid.adm;
if ('nurl' in bid) {
adm += utils.createTrackPixelHtml(bid.nurl);
adm += utils.createTrackPixelHtml(`${bid.nurl}&px=1`);
}
return adm;
}
Expand Down
2 changes: 1 addition & 1 deletion src/adapters/analytics/aol.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ let auctionSchemaTemplate = template`;pubadid=${'pubadid'};hbauctionid=${'hbauct
let winSchemaTemplate = template`;hbauctioneventts=${'hbauctioneventts'};pubadid=${'pubadid'};hbauctionid=${'hbauctionid'};hbwinner=${'hbwinner'};pubcpm=${'pubcpm'}${'hbdealid'};hbbidid=${'hbbidid'}`;
let bidderSchemaTemplate = template`;hbbidder=${'hbbidder'};hbbid=${'hbbid'};hbstatus=${'hbstatus'};hbtime=${'hbtime'}${'hbdealid'};hbbidid=${'hbbidid'}`;

export default utils.extend(adapter({
export default Object.assign(adapter({
url: '',
analyticsType
}), {
Expand Down
8 changes: 7 additions & 1 deletion src/adapters/analytics/aolPartnersIds.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,11 @@
"stickyadstv": 57,
"audienceNetwork": 58,
"thoughtleadr": 59,
"adbund": 60
"adbund": 60,
"tapsense": 61,
"serverbid": 62,
"bidfluence": 63,
"pulsepointLite": 64,
"atomx": 65,
"inneractive": 66
}
3 changes: 1 addition & 2 deletions src/adapters/analytics/example2.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ import { ajax } from 'src/ajax';
*/

import adapter from 'AnalyticsAdapter';
const utils = require('../../utils');

const url = 'https://httpbin.org/post';
const analyticsType = 'endpoint';

export default utils.extend(adapter(
export default Object.assign(adapter(
{
url,
analyticsType
Expand Down
2 changes: 1 addition & 1 deletion src/adapters/analytics/roxot.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const utils = require('../../utils');
const url = '//d.rxthdr.com/analytics';
const analyticsType = 'endpoint';

export default utils.extend(adapter(
export default Object.assign(adapter(
{
url,
analyticsType
Expand Down
2 changes: 1 addition & 1 deletion src/adapters/analytics/sharethrough_analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const analyticsType = 'endpoint';
const STR_BIDDER_CODE = "sharethrough";
const STR_VERSION = "0.1.0";

export default utils.extend(adapter(
export default Object.assign(adapter(
{
emptyUrl,
analyticsType
Expand Down
2 changes: 1 addition & 1 deletion src/adapters/appnexus.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ AppNexusAdapter = function AppNexusAdapter() {
}

//append custom attributes:
var paramsCopy = utils.extend({}, bid.params);
var paramsCopy = Object.assign({}, bid.params);

//delete attributes already used
delete paramsCopy.placementId;
Expand Down
1 change: 1 addition & 0 deletions src/adapters/appnexusAst.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ function AppnexusAstAdapter() {
if (ad && status === STATUS.GOOD) {
bid.cpm = ad.cpm;
bid.creative_id = ad.creative_id;
bid.dealId = ad.deal_id;

if (ad.rtb.video) {
bid.width = ad.rtb.video.player_width;
Expand Down
Loading

0 comments on commit ab3f32e

Please sign in to comment.