Skip to content

Commit 511e124

Browse files
author
m.sorochuk
committed
Merge branch 'master' of https://github.com/prebid/Prebid.js
* 'master' of https://github.com/prebid/Prebid.js: (51 commits) Update maintainer email (prebid#2132) Replace event string with constant (prebid#2128) Add adapter for IAS (prebid#2056) Fix sovrn dealid (prebid#2119) Added support for NURL and ADM as backup (prebid#2112) fix bug where hooked functions w/ no hooks weren't ran immediately (prebid#2115) Increment pre version Prebid 1.3.1 Release Omit app and device if not present rather than send false (prebid#2116) Increment pre version Prebid.js 1.3.0 Release Unit test fixes (prebid#2111) must explicitly list pre1api for it to be included in build (prebid#2097) adkernel adapter additional bid parameters (prebid#2105) removing userSync (prebid#2032) 33across Bid Adapter: Bugfix + Refactor (prebid#2024) Port calling order fix to 1.x (prebid#2067) Update adform adapter request (prebid#2107) Serverbid Bid Adapter: getUserSyncs and new adsizes (prebid#2106) Add hfa and pv parameter to request payload (prebid#2109) ...
2 parents 580f670 + c31cc52 commit 511e124

File tree

77 files changed

+5073
-519
lines changed

Some content is hidden

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

77 files changed

+5073
-519
lines changed

pr_review.md renamed to PR_REVIEW.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
## Summary
2-
We take PR review seriously. Please read https://medium.com/@mrjoelkemp/giving-better-code-reviews-16109e0fdd36#.xa8lc4i23 to understand how a PR review should be conducted. Be rational and strict in your review, make sure you understand exactly what the submitter's intent is. Overall 1 person should take ownership of a particular PR. When they are satisfied it's in good condition to merge, they should request 1 additional team member to review as a sanity check. Only when the PR has 2 `LGTM` from the core team should it be merged.
2+
We take PR review seriously. Please read https://medium.com/@mrjoelkemp/giving-better-code-reviews-16109e0fdd36#.xa8lc4i23 to understand how a PR review should be conducted. Be rational and strict in your review, make sure you understand exactly what the submitter's intent is. Anyone in the community can review a PR, but a Prebid Org member is also required. A Prebid Org member should take ownership of a PR and do the initial review.
3+
4+
If the PR is for a standard bid adapter or a standard analytics adapter, just the one review from a core member is sufficient. The reviewer will check against [required conventions](http://prebid.org/dev-docs/bidder-adaptor.html#required-adapter-conventions) and may merge the PR after approving and confirming that the documentation PR against prebid.org is open and linked to the issue.
5+
6+
For modules and core platform updates, the initial reviewer should request an additional team member to review as a sanity check. Merge should only happen when the PR has 2 `LGTM` from the core team and a documentation PR if required.
37

48
### General PR review Process
59
- Checkout the branch (these instructions are available on the github PR page as well).
@@ -13,7 +17,7 @@ We take PR review seriously. Please read https://medium.com/@mrjoelkemp/giving-b
1317
- If all above is good, add a `LGTM` comment and request 1 additional core member to review.
1418
- Once there is 2 `LGTM` on the PR, merge to master
1519
- Ask the submitter to add a PR for documentation if applicable.
16-
- Add a line into the `draft release` notes for this submission. If no draft release is available, create one using this template https://gist.github.com/mkendall07/c3af6f4691bed8a46738b3675cb5a479
20+
- Add a line into the `draft release` notes for this submission. If no draft release is available, create one using [this template]( https://gist.github.com/mkendall07/c3af6f4691bed8a46738b3675cb5a479)
1721

1822
### New Adapter or updates to adapter process
1923
- Follow steps above for general review process. In addition, please verify the following:
@@ -23,3 +27,20 @@ We take PR review seriously. Please read https://medium.com/@mrjoelkemp/giving-b
2327
- Verify that code re-use is being done properly and that changes introduced by a bidder don't impact other bidders.
2428
- If the adapter being submitted is an alias type, check with the bidder contact that is being aliased to make sure it's allowed.
2529
- If the adapter is triggering any user syncs make sure they are using the user sync module in the Prebid.js core.
30+
- Requests to the bidder should support HTTPS
31+
- Responses from the bidder should be compressed (such as gzip, compress, deflate)
32+
- Bid responses may not use JSONP: All requests must be AJAX with JSON responses
33+
- All user-sync (aka pixel) activity must be registered via the provided functions
34+
- Adapters may not use the $$PREBID_GLOBAL$$ variable
35+
- All adapters must support the creation of multiple concurrent instances. This means, for example, that adapters cannot rely on mutable global variables.
36+
37+
## Ticket Coordinator
38+
39+
Each week, Prebid Org assigns one person to keep an eye on incoming issues and PRs. That person should:
40+
- Review issues and PRs at least once per weekday for new items.
41+
- For PRs: assign PRs to individuals on the PR review list. Try to be equitable -- not all PRs are created equally. Use the "Assigned" field and add the "Needs Review" label.
42+
- For Issues: try to address questions and troubleshooting requests on your own, assigning them to others as needed.
43+
- Issues that are questions or troubleshooting requests may be closed if the originator doesn't respond within a week to requests for confirmation or details.
44+
- Issues that are bug reports should be left open and assigned to someone in PR rotation to confirm or deny the bug status.
45+
- It's polite to check with others before assigning them large tasks.
46+
- If possible, check in on older items and see if they can be unstuck.

gulpfile.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,17 @@ function nodeBundle(modules) {
7171
});
7272
}
7373

74+
// these modules must be explicitly listed in --modules to be included in the build, won't be part of "all" modules
75+
var explicitModules = [
76+
'pre1api'
77+
];
78+
7479
function bundle(dev, moduleArr) {
7580
var modules = moduleArr || helpers.getArgModules(),
7681
allModules = helpers.getModuleNames(modules);
7782

7883
if(modules.length === 0) {
79-
modules = allModules;
84+
modules = allModules.filter(module => !explicitModules.includes(module));
8085
} else {
8186
var diff = _.difference(modules, allModules);
8287
if(diff.length !== 0) {
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
<html>
2+
<head>
3+
<script>
4+
var PREBID_TIMEOUT = 3000;
5+
6+
var googletag = googletag || {};
7+
var sizes = [[728, 90],[300, 250], [300,600]];
8+
googletag.cmd = googletag.cmd || [];
9+
10+
function initAdserver() {
11+
if (pbjs.initAdserverSet) return;
12+
(function() {
13+
var gads = document.createElement('script');
14+
gads.async = true;
15+
gads.type = 'text/javascript';
16+
var useSSL = 'https:' == document.location.protocol;
17+
gads.src = (useSSL ? 'https:' : 'http:') +
18+
'//www.googletagservices.com/tag/js/gpt.js';
19+
var node = document.getElementsByTagName('script')[0];
20+
node.parentNode.insertBefore(gads, node);
21+
})();
22+
pbjs.initAdserverSet = true;
23+
};
24+
setTimeout(initAdserver, PREBID_TIMEOUT);
25+
26+
var pbjs = pbjs || {};
27+
pbjs.que = pbjs.que || [];
28+
(function() {
29+
var pbjsEl = document.createElement("script");
30+
pbjsEl.type = "text/javascript";
31+
pbjsEl.async = true;
32+
pbjsEl.src = '/build/dev/prebid.js';
33+
var pbjsTargetEl = document.getElementsByTagName("head")[0];
34+
pbjsTargetEl.insertBefore(pbjsEl, pbjsTargetEl.firstChild);
35+
})();
36+
37+
pbjs.que.push(function() {
38+
var adUnits = [{
39+
code: 'div-gpt-ad-1460505748561-0',
40+
sizes: [[300, 250], [300,600]],
41+
bids: [
42+
{
43+
bidder: 'appnexus',
44+
params: {
45+
placementId: '12224129'
46+
}
47+
},
48+
]
49+
}];
50+
51+
pbjs.setConfig({
52+
bidderTimeout: 3000,
53+
s2sConfig : {
54+
enabled : true,
55+
bidders : ['appnexus'],
56+
timeout : 1000,
57+
networkId: '9969',
58+
siteId: '985041',
59+
adapter: 'serverbidServer',
60+
//The accountId and endpoint are required by Prebid for validation
61+
//but are not used by ServerBid. They can either be filled in with
62+
//nonsense values, or left out entirely. If left out you will see
63+
//errors in the browser console, but nothing will actually be wrong.
64+
accountId: 9000,
65+
endpoint: "unused"
66+
}
67+
});
68+
69+
pbjs.addAdUnits(adUnits);
70+
71+
pbjs.requestBids({
72+
bidsBackHandler: function(bidResponses) {
73+
initAdserver();
74+
}
75+
})
76+
});
77+
</script>
78+
79+
<script>
80+
googletag.cmd.push(function() {
81+
var rightSlot = googletag.defineSlot('/19968336/header-bid-tag-0', [[300, 250], [300, 600]], 'div-gpt-ad-1460505748561-0').addService(googletag.pubads());
82+
83+
pbjs.que.push(function() {
84+
pbjs.setTargetingForGPTAsync();
85+
});
86+
87+
googletag.pubads().enableSingleRequest();
88+
googletag.enableServices();
89+
});
90+
</script>
91+
</head>
92+
93+
<body>
94+
<h2>Prebid.js S2S Example</h2>
95+
96+
<h5>Div-1</h5>
97+
<div id='div-gpt-ad-1460505748561-0'>
98+
<script type='text/javascript'>
99+
googletag.cmd.push(function() { googletag.display('div-gpt-ad-1460505748561-0'); });
100+
</script>
101+
</div>
102+
</body>
103+
</html>

modules/33acrossBidAdapter.js

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function _createBidResponse(response) {
1616
height: response.seatbid[0].bid[0].h,
1717
ad: response.seatbid[0].bid[0].adm,
1818
ttl: response.seatbid[0].bid[0].ttl || 60,
19-
creativeId: response.seatbid[0].bid[0].ext.rp.advid,
19+
creativeId: response.seatbid[0].bid[0].crid,
2020
currency: response.cur,
2121
netRevenue: true
2222
}
@@ -27,6 +27,9 @@ function _createServerRequest(bidRequest) {
2727
const ttxRequest = {};
2828
const params = bidRequest.params;
2929

30+
/*
31+
* Infer data for the request payload
32+
*/
3033
ttxRequest.imp = [];
3134
ttxRequest.imp[0] = {
3235
banner: {
@@ -38,22 +41,27 @@ function _createServerRequest(bidRequest) {
3841
}
3942
}
4043
}
41-
4244
ttxRequest.site = { id: params.siteId };
43-
4445
// Go ahead send the bidId in request to 33exchange so it's kept track of in the bid response and
4546
// therefore in ad targetting process
4647
ttxRequest.id = bidRequest.bidId;
48+
// Finally, set the openRTB 'test' param if this is to be a test bid
49+
if (params.test === 1) {
50+
ttxRequest.test = 1;
51+
}
4752

53+
/*
54+
* Now construt the full server request
55+
*/
4856
const options = {
4957
contentType: 'application/json',
5058
withCredentials: false
5159
};
52-
5360
// Allow the ability to configure the HB endpoint for testing purposes.
5461
const ttxSettings = config.getConfig('ttxSettings');
5562
const url = (ttxSettings && ttxSettings.url) || END_POINT;
5663

64+
// Return the server request
5765
return {
5866
'method': 'POST',
5967
'url': url,
@@ -93,12 +101,7 @@ function isBidRequestValid(bid) {
93101
return false;
94102
}
95103

96-
if ((typeof bid.params.site === 'undefined' || typeof bid.params.site.id === 'undefined') &&
97-
(typeof bid.params.siteId === 'undefined')) {
98-
return false;
99-
}
100-
101-
if (typeof bid.params.productId === 'undefined') {
104+
if (typeof bid.params.siteId === 'undefined' || typeof bid.params.productId === 'undefined') {
102105
return false;
103106
}
104107

modules/adformBidAdapter.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {registerBidder} from 'src/adapters/bidderFactory';
55
const BIDDER_CODE = 'adform';
66
export const spec = {
77
code: BIDDER_CODE,
8-
supportedMediaTypes: [],
98
isBidRequestValid: function (bid) {
109
return !!(bid.params.mid);
1110
},
@@ -35,7 +34,7 @@ export const spec = {
3534

3635
request.unshift('//' + globalParams[0][1] + '/adx/?rp=4');
3736

38-
request.push('stid=' + validBidRequests[0].requestId);
37+
request.push('stid=' + validBidRequests[0].auctionId);
3938

4039
for (i = 1, l = globalParams.length; i < l; i++) {
4140
_key = globalParams[i][0];

0 commit comments

Comments
 (0)