Skip to content

Commit b930704

Browse files
committed
Merge branch 'master' of https://github.com/prebid/Prebid.js into prebuilt
* 'master' of https://github.com/prebid/Prebid.js: (38 commits) Add optional domain parameter to AdButler adapter (prebid#1078) Send transactionID to Criteo Services (prebid#1113) Fix `buildMasterVideoTagFromAdserverTag()` not selecting winning bid (prebid#1106) Remove placement size selection and filtering (prebid#1107) revert `srcdoc` change (prebid#1130) Add new Adapter- Beachfront Media (prebid#1062) Fixes SpringServe adapter (prebid#1101) Update Widespace request param (prebid#1098) - New Adapter: Innity (prebid#1074) Update Roxot prebid analytic adapter (prebid#1034) Yarn Package Manager (prebid#1109) allow writing into current document if prebid is loaded inside an iframe (prebid#1066) Adapter bug fix (prebid#1096) fix typo added pr review process and governance model (prebid#1103) added support for sampling in ga and base adapter, fixed up some tests (prebid#1011) 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) ...
2 parents 39c40c5 + 6a6724c commit b930704

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+11148
-868
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Thank you for your pull request. Please make sure this PR is scoped to one chang
66
<!-- Remove items that don't apply and/or select an item by changing [ ] to [x] -->
77
- [ ] Bugfix
88
- [ ] Feature
9-
- [ ] New bidder adapter
9+
- [ ] 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 -->
1010
- [ ] Code style update (formatting, local variables)
1111
- [ ] Refactoring (no functional changes, no api changes)
1212
- [ ] Build related changes

README.md

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ This README is for developers who want to contribute to Prebid.js. For user-fac
2424

2525
$ git clone https://github.com/prebid/Prebid.js.git
2626
$ cd Prebid.js
27-
$ npm install
27+
$ yarn install
2828

29-
If you experience errors after a version update, try a fresh install:
29+
Prebid now supports the `yarn` npm client. This is an alternative to using `npm` for package management, though `npm` will continue to work as before.
3030

31-
$ rm -rf ./node_modules && npm cache clean && npm install
31+
For more info about yarn see https://yarnpkg.com
3232

3333
<a name="Build"></a>
3434

@@ -64,19 +64,22 @@ For example, in `path/to/your/list-of-adapters.json`, write:
6464
Building with just these adapters will result in a smaller bundle which should allow your pages to load faster.
6565

6666
**Build standalone prebid.js**
67+
Prebid now supports the `yarn` npm client. This is an alternative to using `npm` for package management, though `npm` will continue to work as before.
6768

68-
- Clone the repo, run `npm install`
69+
For more info about yarn see https://yarnpkg.com
70+
71+
- Clone the repo, run `yarn install`
6972
- Duplicate `adapters.json` to e.g. `list-of-adapters.json`
7073
- Remove the unnecessary adapters from `list-of-adapters.json`
7174
- Then run the build:
7275

7376
$ gulp build --adapters path/to/your/list-of-adapters.json
7477

75-
**Build prebid.js using NPM for bundling**
78+
**Build prebid.js using Yarn for bundling**
7679

77-
In case you'd like to explicitly show that your project uses `prebid.js` and want a reproducible build, consider adding it as an `npm` dependency.
80+
In case you'd like to explicitly show that your project uses `prebid.js` and want a reproducible build, consider adding it as an `yarn` dependency.
7881

79-
- Install `prebid.js` as an `npm` dependency of your project
82+
- Add `prebid.js` as a `yarn` dependency of your project: `yarn add prebid.js`
8083
- Duplicate `node_modules/prebid.js/adapters.json` to under your project path, e.g. `path/to/your/list-of-adapters.json`
8184
- Remove the unnecessary adapters
8285
- Run the `prebid.js` build under the `node_modules/prebid.js/` folder
@@ -131,7 +134,7 @@ This runs code quality checks, generates all the necessary files and starts a we
131134

132135
To run the example file, go to:
133136

134-
+ `http://localhost:9999/integrationExamples/gpt/pbjs_example_gpt.html`
137+
+ `http://localhost:9999/integrationExamples/gpt/pbjs_example_gpt.html`
135138

136139
To view a test coverage report, go to:
137140

@@ -143,13 +146,15 @@ A watch is also in place that will run continuous tests in the terminal as you e
143146

144147
## Contribute
145148

146-
Many SSPs, bidders, and publishers have contributed to this project. [20+ Bidders](https://github.com/prebid/Prebid.js/tree/master/src/adapters) are supported by Prebid.js.
149+
Many SSPs, bidders, and publishers have contributed to this project. [60+ Bidders](https://github.com/prebid/Prebid.js/tree/master/src/adapters) are supported by Prebid.js.
150+
151+
Our PR review process can be found [here](https://github.com/prebid/Prebid.js/tree/master/pr_review.md).
147152

148153
### Add a Bidder Adapter
149154

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

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

154159
### Code Quality
155160

@@ -167,13 +172,13 @@ This will run tests and keep the Karma test browser open. If your `prebid.js` fi
167172

168173
+ For test results, see the console
169174

170-
+ To set breakpoints in source code, see the developer tools
175+
+ To set breakpoints in source code, see the developer tools
171176

172177
Detailed code coverage reporting can be generated explicitly with
173178

174179
$ gulp test --coverage
175180

176-
The results will be in
181+
The results will be in
177182

178183
./build/coverage
179184

@@ -184,3 +189,6 @@ For instructions on writing tests for Prebid.js, see [Testing Prebid.js](http://
184189
### Supported Browsers
185190

186191
Prebid.js is supported on IE9+ and modern browsers.
192+
193+
### Governance
194+
Review our governance model [here](https://github.com/prebid/Prebid.js/tree/master/governance.md).

adapters.json

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,18 @@
1212
"aol",
1313
"appnexus",
1414
"appnexusAst",
15+
"beachfront",
16+
"audienceNetwork",
1517
"conversant",
1618
"districtmDMX",
1719
"fidelity",
1820
"gumgum",
1921
"hiromedia",
2022
"indexExchange",
23+
"innity",
2124
"kruxlink",
2225
"getintent",
26+
"inneractive",
2327
"komoona",
2428
"lifestreet",
2529
"mantis",
@@ -56,6 +60,7 @@
5660
"vertoz",
5761
"widespace",
5862
"admixer",
63+
"atomx",
5964
"tapsense",
6065
{
6166
"appnexus": {
@@ -86,6 +91,11 @@
8691
"supportedMediaTypes": ["video"]
8792
}
8893
},
94+
{
95+
"beachfront": {
96+
"supportedMediaTypes": ["video"]
97+
}
98+
},
8999
{
90100
"appnexus": {
91101
"alias": "matomy"
@@ -101,7 +111,7 @@
101111
"appnexus": {
102112
"alias": "featureforward"
103113
}
104-
},
114+
},
105115
{
106116
"appnexus": {
107117
"alias": "oftmedia"
@@ -116,6 +126,15 @@
116126
"getintent": {
117127
"supportedMediaTypes" : ["video"]
118128
}
129+
},
130+
{
131+
"stickyadstv": {
132+
"alias": "freewheel-ssp"
133+
}
134+
},
135+
{
136+
"rhythmone": {
137+
"supportedMediaTypes": ["video"]
138+
}
119139
}
120-
121140
]

analytics.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[]

governance.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
### Overview:
2+
3+
This document describes the governance model for the Prebid project. The Prebid project’s stated mission is to facilitate fair, transparent, and effective header bidding across the industry, and is responsible for creating and maintaining such projects as [Prebid.js](https://github.com/prebid/Prebid.js).
4+
5+
1. A single Tech Lead oversees the technical direction of the project and appoints Core Team members
6+
2. The Core Team members maintain the project on an ongoing basis with direction from the Tech Lead.
7+
3. In the event of any disagreements, the Tech Lead will make a final decision.
8+
4. If there is no Tech Lead available to perform his/her duties, AppNexus Inc. will appoint one.
9+
10+
### Roles and Responsibilities:
11+
- **User:** Any individual who consumes / uses the Prebid.js library.
12+
- **Contributor:** Any individual who contributes code that is subsequently merged to the project. Contributed code is governed by the Prebid.js [license](https://github.com/prebid/Prebid.js/blob/master/LICENSE). Contributors are required to sign a CLA before any code can be committed (CLA pending).
13+
- **Core Team Member:** An individual contributor who has been appointed by the Tech Lead on the project to maintain it and further it’s stated goals.
14+
- **Tech Lead:** The Tech Lead is responsible for overall technical direction of the project. The Tech Lead will work closely with Core Team members to facilitate development and further the project goals.
15+
16+
### Current Prebid.js Core Team
17+
- @mkendall07 (Tech Lead)
18+
- @protonate
19+
- @matthewlane
20+
- @jaiminpanchal27
21+
- @snapwich
22+
- @harpere
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
<html>
2+
<head>
3+
<script src="/build/dev/prebid.js" async></script>
4+
<script>
5+
var PREBID_TIMEOUT = 2000;
6+
var adUnits = [{
7+
code: '/5555555/hb_300x250',
8+
sizes: [[300, 250]],
9+
bids: [{
10+
bidder: 'audienceNetwork',
11+
params: {
12+
placementId: '555555555555555_555555555555555'
13+
}
14+
}]
15+
}];
16+
17+
(function () {
18+
var gads = document.createElement('script');
19+
gads.async = true;
20+
gads.type = 'text/javascript';
21+
var useSSL = 'https:' == document.location.protocol;
22+
gads.src = (useSSL ? 'https:' : 'http:') + '//www.googletagservices.com/tag/js/gpt.js';
23+
var node = document.getElementsByTagName('script')[0];
24+
node.parentNode.insertBefore(gads, node);
25+
})();
26+
27+
var googletag = googletag || {};
28+
googletag.cmd = googletag.cmd || [];
29+
googletag.cmd.push(function() {
30+
googletag.pubads().disableInitialLoad();
31+
});
32+
googletag.cmd.push(function () {
33+
googletag.defineSlot('/5555555/hb_300x250', [[300, 250]], 'div-gpt-ad-5555555555555-0').addService(googletag.pubads());
34+
googletag.pubads().enableSingleRequest();
35+
googletag.enableServices();
36+
});
37+
38+
var sendAdserverRequest = function () {
39+
if (pbjs.adserverRequestSent) return;
40+
pbjs.adserverRequestSent = true;
41+
googletag.cmd.push(function() {
42+
pbjs.que.push(function() {
43+
pbjs.setTargetingForGPTAsync();
44+
googletag.pubads().refresh();
45+
});
46+
});
47+
};
48+
49+
setTimeout(function() {
50+
sendAdserverRequest();
51+
}, PREBID_TIMEOUT);
52+
53+
var pbjs = pbjs || {};
54+
pbjs.que = pbjs.que || [];
55+
56+
pbjs.que.push(function() {
57+
pbjs.addAdUnits(adUnits);
58+
pbjs.requestBids({
59+
bidsBackHandler: sendAdserverRequest
60+
});
61+
});
62+
</script>
63+
</head>
64+
<body>
65+
<h2>Prebid.js Test</h2>
66+
<div id='div-gpt-ad-5555555555555-0'>
67+
<script>
68+
googletag.cmd.push(function() {
69+
googletag.display('div-gpt-ad-5555555555555-0');
70+
});
71+
</script>
72+
</div>
73+
<div>
74+
<p>Audience Network quick start</p>
75+
<ol>
76+
<li>Create a new App at <a href="https://developers.facebook.com/apps">https://developers.facebook.com/apps</a></li>
77+
<li>Add the Audience Network product to it</li>
78+
<li>Create a new Placement to generate your placementId</li>
79+
<li>To test, ensure the User-Agent request header represents a mobile device</li>
80+
</ol>
81+
</div>
82+
</body>
83+
</html>

integrationExamples/gpt/pbjs_example_gpt.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,12 @@
249249
params: {
250250
zone: '2eb6bd58-865c-47ce-af7f-a918108c3fd2' // REQUIRED zone oid
251251
}
252+
},
253+
{
254+
bidder: 'atomx',
255+
params: {
256+
id: 7395
257+
}
252258
}
253259
]
254260
}, {
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8">
5+
<!-- Prebid Config Section START -->
6+
<!-- Make sure this is inserted before your GPT tag -->
7+
<script>
8+
var PREBID_TIMEOUT = 1000;
9+
10+
var adUnits = [{
11+
code: 'div-gpt-ad-1460505748561-0',
12+
sizes: [[300, 250]],
13+
bids: [{
14+
bidder: 'innity',
15+
params: {
16+
pub: 267,
17+
zone: 62546
18+
}
19+
}
20+
]
21+
}];
22+
23+
var pbjs = pbjs || {};
24+
pbjs.que = pbjs.que || [];
25+
26+
</script>
27+
<!-- Prebid Config Section END -->
28+
29+
<!-- Prebid Boilerplate Section START. No Need to Edit. -->
30+
<script type="text/javascript" src="../../build/dev/prebid.js" async></script>
31+
<script>
32+
var googletag = googletag || {};
33+
googletag.cmd = googletag.cmd || [];
34+
googletag.cmd.push(function() {
35+
googletag.pubads().disableInitialLoad();
36+
});
37+
38+
pbjs.que.push(function() {
39+
pbjs.addAdUnits(adUnits);
40+
pbjs.requestBids({
41+
bidsBackHandler: sendAdserverRequest
42+
});
43+
});
44+
45+
function sendAdserverRequest() {
46+
if (pbjs.adserverRequestSent) return;
47+
pbjs.adserverRequestSent = true;
48+
googletag.cmd.push(function() {
49+
pbjs.que.push(function() {
50+
pbjs.setTargetingForGPTAsync();
51+
googletag.pubads().refresh();
52+
});
53+
});
54+
}
55+
56+
setTimeout(function() {
57+
sendAdserverRequest();
58+
}, PREBID_TIMEOUT);
59+
60+
</script>
61+
<!-- Prebid Boilerplate Section END -->
62+
63+
<script>
64+
(function () {
65+
var gads = document.createElement('script');
66+
gads.async = true;
67+
gads.type = 'text/javascript';
68+
var useSSL = 'https:' == document.location.protocol;
69+
gads.src = (useSSL ? 'https:' : 'http:') +
70+
'//www.googletagservices.com/tag/js/gpt.js';
71+
var node = document.getElementsByTagName('script')[0];
72+
node.parentNode.insertBefore(gads, node);
73+
})();
74+
</script>
75+
76+
<script>
77+
googletag.cmd.push(function () {
78+
googletag.defineSlot('/19968336/header-bid-tag-0', [[300, 250]], 'div-gpt-ad-1460505748561-0').addService(googletag.pubads());
79+
googletag.pubads().enableSingleRequest();
80+
googletag.enableServices();
81+
});
82+
</script>
83+
</head>
84+
85+
<body>
86+
<h2>Prebid.js Test</h2>
87+
<h5>Div-1</h5>
88+
<div id='div-gpt-ad-1460505748561-0'>
89+
<script type='text/javascript'>
90+
googletag.cmd.push(function() { googletag.display('div-gpt-ad-1460505748561-0'); });
91+
</script>
92+
</div>
93+
</body>
94+
</html>

loaders/adapterLoader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const fs = require('fs');
88
const blockLoader = require('block-loader');
99
const getAdapters = require('./getAdapters');
1010

11-
const adapters = getAdapters();
11+
const adapters = getAdapters('adapters.json', 'adapters');
1212
const files = fs.readdirSync('src/adapters').map((file) => file.replace(/\.[^/.]+$/, ''));
1313
const adapterNames = adapters.filter(getStandardAdapters).filter(getUniques);
1414
//adapters loaded from `srcPath`

0 commit comments

Comments
 (0)