Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge Prebid 1.0 to Master #1936

Merged
merged 49 commits into from
Dec 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
1bdedd6
Concurrent auctions (#1593)
jaiminpanchal27 Sep 26, 2017
8f34dd5
Add ignore-loader to handle .md files (#1646)
thewizarodofoz Oct 3, 2017
e441723
Auction module refactor (#1644)
jaiminpanchal27 Oct 6, 2017
f7a1789
Config api updates (#1633)
jaiminpanchal27 Oct 10, 2017
09bfa63
Merge branch 'master' of github.com:prebid/Prebid.js into prebid-1.0
jaiminpanchal27 Oct 10, 2017
df3fb3d
Merge branch 'master' of github.com:prebid/Prebid.js into prebid-1.0
jaiminpanchal27 Oct 11, 2017
e5b703e
Adapter/rubicon bid adapter markup (#1674)
bretg Oct 16, 2017
feebc17
Prebid 1.0 Fix issue with video bid validation (#1680)
jsalis Oct 18, 2017
e7335d7
Merge branch 'master' of github.com:prebid/Prebid.js into prebid-1.0
jaiminpanchal27 Oct 18, 2017
f0ae76c
Merge branch 'master' of github.com:prebid/Prebid.js into prebid-1.0
jaiminpanchal27 Oct 25, 2017
818d6c2
Merge branch 'master' of github.com:prebid/Prebid.js into prebid-1.0
jaiminpanchal27 Oct 27, 2017
cde5f3a
Merge branch 'master' of github.com:prebid/Prebid.js into prebid-1.0
jaiminpanchal27 Nov 1, 2017
28ac151
Auction module updated to support currency/hook (#1733)
jaiminpanchal27 Nov 6, 2017
b165205
Merge branch 'prebid-1.0' of github.com:prebid/Prebid.js into prebid-1.0
jaiminpanchal27 Nov 6, 2017
04f359a
Merge branch 'master' of github.com:prebid/Prebid.js into prebid-1.0
jaiminpanchal27 Nov 6, 2017
f14f4ee
Fixed video unit test
jaiminpanchal27 Nov 6, 2017
6e552de
updated sizeMapping to use sizeConfig and support labels (#1772)
snapwich Nov 9, 2017
74fe06a
update package.json with correct version. (#1813)
Nov 9, 2017
d7d1738
Unit test fixes for IE 10 and other old browsers (#1810)
jaiminpanchal27 Nov 10, 2017
a413944
Merge branch 'master' of github.com:prebid/Prebid.js into prebid-1.0
jaiminpanchal27 Nov 20, 2017
28d0703
Rename appnexusAst adapter to appnexus adapter (#1848)
jaiminpanchal27 Nov 20, 2017
45dc8aa
fixed safeframe for 1.0 (#1834)
jaiminpanchal27 Nov 20, 2017
6b387f3
Emit array of objects from BID_TIMEOUT event (#1824)
matthewlane Nov 21, 2017
1fecaf9
Move public winningBids to auction (#1828)
jaiminpanchal27 Nov 21, 2017
5276f70
Updates for PubWise Prebid 1.0 Support (#1847)
GLStephen Nov 22, 2017
2094ea4
update JSDoc comment. Remove trailing space (#1872)
bansawbanchee Nov 22, 2017
71b4e6c
Prebid 1.0 adxcg analytics adapter fix for bidtimeout event (#1871)
adxcgcom Nov 27, 2017
bbc2df0
Prebid 1.0 prebid server (#1846)
snapwich Nov 28, 2017
31f8bed
Merge branch 'master' of github.com:prebid/Prebid.js into prebid-1.0
jaiminpanchal27 Nov 29, 2017
11ae6bf
Targeting updates (#1689)
jaiminpanchal27 Nov 29, 2017
3758bd7
make sure we have the right version
Dec 1, 2017
6cd4929
Update version to fix invalid semver
snapwich Dec 1, 2017
643c140
Merge branch 'master' of github.com:prebid/Prebid.js into prebid-1.0
jaiminpanchal27 Dec 4, 2017
cb4018a
video bug fix (#1906)
jaiminpanchal27 Dec 4, 2017
d5f0a21
Manually merge bidManager code to auction module (#1905)
jaiminpanchal27 Dec 5, 2017
1f115d0
Merge branch 'master' of github.com:prebid/Prebid.js into prebid-1.0
jaiminpanchal27 Dec 6, 2017
c2ef33b
Unit test fix in IE for adxcgAnalytics Adapter (#1929)
jaiminpanchal27 Dec 6, 2017
87bfe40
added log message for xhr timeout (#1928)
harpere Dec 6, 2017
de5ed4d
remove polyfill.js and remove global polyfills (#1918)
snapwich Dec 6, 2017
aa7178b
Merge branch 'master' of github.com:prebid/Prebid.js into prebid-1.0
jaiminpanchal27 Dec 6, 2017
d33c64d
Replace usePrebidCache with cache:url and remove default (#1904)
snapwich Dec 6, 2017
9355c07
pulsepointLiteBidAdapter renamed to pulsepointBidAdapter (#1931)
anand-venkatraman Dec 6, 2017
ec3519e
add 'x_source.tid' to rubicon requests (#1933)
snapwich Dec 6, 2017
9f3728d
Bring in pre-1.0 native-image asset adapter change (#1934)
matthewlane Dec 6, 2017
df05cb8
Merge branch 'master' of github.com:prebid/Prebid.js into prebid-1.0
jaiminpanchal27 Dec 6, 2017
ae8decc
33Across Adapter: Removed the usage of utils library (#1917)
curlyblueeagle Dec 6, 2017
5445b7c
Prebid 1.0 server cache (#1935)
snapwich Dec 6, 2017
6c15dc5
Merge branch 'master' of github.com:prebid/Prebid.js into prebid-1.0
jaiminpanchal27 Dec 6, 2017
1c9d4a8
Merge branch 'master' of github.com:prebid/Prebid.js into prebid-1.0
jaiminpanchal27 Dec 6, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"presets": ["es2015"],
"plugins": ["transform-object-assign", "transform-es3-property-literals", "transform-es3-member-expression-literals"]
"plugins": [
"transform-object-assign",
"transform-es3-property-literals",
"transform-es3-member-expression-literals"
]
}
170 changes: 85 additions & 85 deletions integrationExamples/gpt/hello_world.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,91 +12,91 @@
-->

<html>
<head>
<script>
var PREBID_TIMEOUT = 700;

var adUnits = [{
code: 'div-gpt-ad-1460505748561-0',
sizes: [[300, 250], [300,600]],

// Replace this object to test a new Adapter!
bids: [{
bidder: 'appnexus',
params: {
placementId: '10433394'
}
}]

}];

var pbjs = pbjs || {};
pbjs.que = pbjs.que || [];

</script>

<script type="text/javascript" src="../../build/dev/prebid.js" async></script>
<script>
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
googletag.cmd.push(function() {
googletag.pubads().disableInitialLoad();
});

pbjs.que.push(function() {
pbjs.addAdUnits(adUnits);
pbjs.requestBids({
bidsBackHandler: sendAdserverRequest
});
});

function sendAdserverRequest() {
if (pbjs.adserverRequestSent) return;
pbjs.adserverRequestSent = true;
<head>
<script>
var PREBID_TIMEOUT = 700;

var adUnits = [{
code: 'div-gpt-ad-1460505748561-0',
sizes: [[300, 250], [300,600]],

// Replace this object to test a new Adapter!
bids: [{
bidder: 'appnexusAst',
params: {
placementId: '10433394'
}
}]

}];

var pbjs = pbjs || {};
pbjs.que = pbjs.que || [];

</script>

<script type="text/javascript" src="../../build/dev/prebid.js" async></script>
<script>
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
googletag.cmd.push(function() {
pbjs.que.push(function() {
pbjs.setTargetingForGPTAsync();
googletag.pubads().refresh();
googletag.pubads().disableInitialLoad();
});

pbjs.que.push(function() {
pbjs.addAdUnits(adUnits);
pbjs.requestBids({
bidsBackHandler: sendAdserverRequest
});
});
}

setTimeout(function() {
sendAdserverRequest();
}, PREBID_TIMEOUT);

</script>

<script>
(function () {
var gads = document.createElement('script');
gads.async = true;
gads.type = 'text/javascript';
var useSSL = 'https:' == document.location.protocol;
gads.src = (useSSL ? 'https:' : 'http:') +
'//www.googletagservices.com/tag/js/gpt.js';
var node = document.getElementsByTagName('script')[0];
node.parentNode.insertBefore(gads, node);
})();
</script>

<script>
googletag.cmd.push(function () {
googletag.defineSlot('/19968336/header-bid-tag-0', [[300, 250], [300, 600]], 'div-gpt-ad-1460505748561-0').addService(googletag.pubads());

googletag.pubads().enableSingleRequest();
googletag.enableServices();
});
</script>
</head>

<body>
<h2>Prebid.js Test</h2>
<h5>Div-1</h5>
<div id='div-gpt-ad-1460505748561-0'>
<script type='text/javascript'>
googletag.cmd.push(function() { googletag.display('div-gpt-ad-1460505748561-0'); });
</script>
</div>
</body>
</html>

function sendAdserverRequest() {
if (pbjs.adserverRequestSent) return;
pbjs.adserverRequestSent = true;
googletag.cmd.push(function() {
pbjs.que.push(function() {
pbjs.setTargetingForGPTAsync();
googletag.pubads().refresh();
});
});
}

setTimeout(function() {
sendAdserverRequest();
}, PREBID_TIMEOUT);

</script>

<script>
(function () {
var gads = document.createElement('script');
gads.async = true;
gads.type = 'text/javascript';
var useSSL = 'https:' == document.location.protocol;
gads.src = (useSSL ? 'https:' : 'http:') +
'//www.googletagservices.com/tag/js/gpt.js';
var node = document.getElementsByTagName('script')[0];
node.parentNode.insertBefore(gads, node);
})();
</script>

<script>
googletag.cmd.push(function () {
googletag.defineSlot('/19968336/header-bid-tag-0', [[300, 250], [300, 600]], 'div-gpt-ad-1460505748561-0').addService(googletag.pubads());

googletag.pubads().enableSingleRequest();
googletag.enableServices();
});
</script>
</head>

<body>
<h2>Prebid.js Test</h2>
<h5>Div-1</h5>
<div id='div-gpt-ad-1460505748561-0'>
<script type='text/javascript'>
googletag.cmd.push(function() { googletag.display('div-gpt-ad-1460505748561-0'); });
</script>
</div>
</body>
</html>
65 changes: 32 additions & 33 deletions modules/33acrossBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { userSync } from 'src/userSync'
const { registerBidder } = require('../src/adapters/bidderFactory');
const utils = require('../src/utils');
const { config } = require('../src/config');

const BIDDER_CODE = '33across';
const END_POINT = 'https://ssc.33across.com/api/v1/hb';
Expand Down Expand Up @@ -38,9 +39,7 @@ function _createServerRequest(bidRequest) {
}
}

// Allowing site to be a test configuration object or just the id (former required for testing,
// latter when used by publishers)
ttxRequest.site = params.site || { id: params.siteId };
ttxRequest.site = { id: params.siteId };

// Go ahead send the bidId in request to 33exchange so it's kept track of in the bid response and
// therefore in ad targetting process
Expand All @@ -51,28 +50,18 @@ function _createServerRequest(bidRequest) {
withCredentials: false
};

if (bidRequest.params.customHeaders) {
options.customHeaders = bidRequest.params.customHeaders;
}
// Allow the ability to configure the HB endpoint for testing purposes.
const ttxSettings = config.getConfig('ttxSettings');
const url = (ttxSettings && ttxSettings.url) || END_POINT;

return {
'method': 'POST',
'url': bidRequest.params.url || END_POINT,
'url': url,
'data': JSON.stringify(ttxRequest),
'options': options
}
}

// Sync object will always be of type iframe for ttx
function _createSync(bid) {
const syncUrl = bid.params.syncUrl || SYNC_ENDPOINT;

return {
type: 'iframe',
url: `${syncUrl}&id=${bid.params.siteId || bid.params.site.id}`
}
}

function _getFormatSize(sizeArr) {
return {
w: sizeArr[0],
Expand All @@ -81,6 +70,24 @@ function _getFormatSize(sizeArr) {
}
}

// Register one sync per bid since each ad unit may potenitally be linked to a uniqe guid
// Sync type will always be 'iframe' for 33Across
function _registerUserSyncs(requestData) {
let ttxRequest;
try {
ttxRequest = JSON.parse(requestData);
} catch (err) {
// No point in trying to register sync since the requisite data cannot be parsed.
return;
}
const ttxSettings = config.getConfig('ttxSettings');

let syncUrl = (ttxSettings && ttxSettings.syncUrl) || SYNC_ENDPOINT;

syncUrl = `${syncUrl}&id=${ttxRequest.site.id}`;
userSync.registerSync('iframe', BIDDER_CODE, syncUrl);
}

function isBidRequestValid(bid) {
if (bid.bidder !== BIDDER_CODE || typeof bid.params === 'undefined') {
return false;
Expand All @@ -104,7 +111,12 @@ function buildRequests(bidRequests) {
}

// NOTE: At this point, the response from 33exchange will only ever contain one bid i.e. the highest bid
function interpretResponse(serverResponse) {
function interpretResponse(serverResponse, bidRequest) {
// Register user sync first
if (bidRequest && bidRequest.data) {
_registerUserSyncs(bidRequest.data);
}

const bidResponses = [];

// If there are bids, look at the first bid of the first seatbid (see NOTE above for assumption about ttx)
Expand All @@ -115,24 +127,11 @@ function interpretResponse(serverResponse) {
return bidResponses;
}

// Register one sync per bid since each ad unit may potenitally be linked to a uniqe guid
function getUserSyncs(syncOptions) {
let syncs = [];
const ttxBidRequests = utils.getBidderRequestAllAdUnits(BIDDER_CODE).bids;

if (syncOptions.iframeEnabled) {
syncs = ttxBidRequests.map(_createSync);
}

return syncs;
}

const spec = {
code: BIDDER_CODE,
isBidRequestValid,
buildRequests,
interpretResponse,
getUserSyncs
interpretResponse
}

registerBidder(spec);
Expand Down
Loading