-
Notifications
You must be signed in to change notification settings - Fork 8
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
Override s2s cookieseturl #10
Changes from 5 commits
ef58cc9
95b2c67
dfa05f6
1eda730
c0ecb13
65f078b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,165 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<style type="text/css"> | ||
nav a { | ||
display: inline-block; | ||
color: black; | ||
padding: 0.5em; | ||
text-align: center; | ||
border-radius: 0.5em; | ||
text-decoration: none; | ||
border: 1px solid black; | ||
} | ||
</style> | ||
|
||
<script> | ||
var PREBID_TIMEOUT = 2000; | ||
|
||
var adUnits = [ | ||
{ | ||
code: 'test-div', | ||
sizes: [[728,90]], | ||
bids: [ | ||
{ | ||
bidder: 'rubicon', | ||
params: { | ||
accountId: 1001, | ||
siteId: 113932, | ||
zoneId: 535510 | ||
} | ||
} | ||
] | ||
}, | ||
{ | ||
code: 'test-div2', | ||
sizes: [[300,250]], | ||
bids: [ | ||
{ | ||
bidder: 'rubicon', | ||
params: { | ||
accountId: 1001, | ||
siteId: 113932, | ||
zoneId: 535510 | ||
} | ||
} | ||
] | ||
} | ||
]; | ||
|
||
var pbjs = pbjs || {}; | ||
pbjs.que = pbjs.que || []; | ||
|
||
</script> | ||
<!--<script type="text/javascript" src="http://ads.rubiconproject.com/prebid/1001.js" async></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.logging = true; | ||
pbjs.setConfig({s2sConfig:{ | ||
// String (required): The account ID | ||
// accountId: '0acfb8cd-48de-4102-b519-01d1898ab87e', | ||
accountId: '1001', | ||
|
||
// Boolean (required): Enables S2S - defaults to `false`. | ||
enabled: true, | ||
|
||
// Array[String] (required): List of bidder codes to enable for S2S. | ||
// Note that these must have been included in the Prebid.js build | ||
// from Step 2. | ||
bidders: ['rubicon'], | ||
|
||
// Number (optional): Timeout for bidders called via the S2S | ||
// endpoint, in milliseconds. Default value is 1000. | ||
timeout: 1000, | ||
|
||
syncEndpoint: 'https://prebid-server.rubiconproject.com/cookie_sync', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same - maybe something like |
||
|
||
// String (optional): Adapter code for S2S. Defaults to 'prebidServer'. | ||
adapter: 'prebidServer', | ||
|
||
// String (optional): Will override the default endpoint for Prebid Server. | ||
endpoint: 'https://pbs-qa.aws.rubiconproject.com/auction?url_override=rubiconproject.com&debug=1', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same. |
||
|
||
// String (optional): Will override the default cookieSet endpoint for Prebid Server. | ||
/*cookieSetUrl : 'https://assets.rubiconproject.com/utils/cookieset/cs.js'*/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same. |
||
cookieSetUrl : 'cs.js' | ||
}}); | ||
|
||
pbjs.addAdUnits(adUnits); | ||
pbjs.enableSendAllBids(); | ||
pbjs.requestBids({ | ||
bidsBackHandler: sendAdserverRequest | ||
}); | ||
}); | ||
|
||
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('/112115922/FL_PB_MedRect', [[728,90]], 'test-div').addService(googletag.pubads()); | ||
googletag.defineSlot('/112115922/FL_PB_MedRect', [[300,250]], 'test-div2').addService(googletag.pubads()); | ||
googletag.pubads().enableSingleRequest(); | ||
googletag.enableServices(); | ||
}); | ||
</script> | ||
</head> | ||
|
||
<body> | ||
<img src="prebid-trigger.gif" /> | ||
<header> | ||
<h1>Safari 3rd party set cookie workaround</h1> | ||
<nav> | ||
<a href="pages/page-one.html">site sub-page #1</a> | ||
<a href="pages/page-two.html">site sub-page #2</a> | ||
</nav> | ||
<h2>Rubicon Project Prebid Server Demo</h2> | ||
</header> | ||
<p>The ad units below were retrieved from Rubicon Project's cluster of Prebid Servers.</p> | ||
<div id='test-div'> | ||
<script> | ||
googletag.cmd.push(function() { googletag.display('test-div'); }); | ||
</script> | ||
</div> | ||
<div id='test-div2'> | ||
<script> | ||
googletag.cmd.push(function() { googletag.display('test-div2'); }); | ||
</script> | ||
</div> | ||
</body> | ||
</html> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's not reference our rubicon resources in the examples.