forked from prebid/Prebid.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master'
- Loading branch information
Showing
516 changed files
with
60,552 additions
and
15,515 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
167 changes: 167 additions & 0 deletions
167
integrationExamples/gpt/captifyRtdProvider_example.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,167 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||
<meta name=viewport content="width=device-width, initial-scale=1"> | ||
<script type="text/javascript" src="https://cache.consentframework.com/js/pa/1020/c/Y1Dhs/stub" charset="utf-8"></script> | ||
<script type="text/javascript" async src="https://choices.consentframework.com/js/pa/1020/c/Y1Dhs/cmp" charset="utf-8"></script> | ||
</head> | ||
<body> | ||
|
||
<script async src="https://pagead2.googlesyndication.com/tag/js/gpt.js"></script> | ||
<script src="prebid.js" async></script> | ||
|
||
<script> | ||
var pbjs = pbjs || {}; | ||
pbjs.que = pbjs.que || []; | ||
|
||
pbjs.que.push(function() { | ||
pbjs.setConfig({ | ||
debug: true, | ||
realTimeData: { | ||
auctionDelay: 1000, | ||
dataProviders: [ | ||
{ | ||
name: "CaptifyRTDModule", | ||
waitForIt: true, | ||
params: { | ||
pubId: 11287, | ||
bidders: ['appnexus'], | ||
} | ||
} | ||
] | ||
}, | ||
consentManagement: { | ||
usp: { | ||
cmpApi: 'iab', | ||
timeout: 100 // US Privacy timeout 100ms | ||
}, | ||
gdpr: { | ||
cmpApi: 'iab', | ||
timeout: 8000, | ||
defaultGdprScope: true, | ||
getTCData: { | ||
tcString: 'COwK6gaOwK6gaFmAAAENAPCAAAAAAAAAAAAAAAAAAAAA.IFoEUQQgAIQwgIwQABAEAAAAOIAACAIAAAAQAIAgEAACEAAAAAgAQBAAAAAAAGBAAgAAAAAAAFAAECAAAgAAQARAEQAAAAAJAAIAAgAAAYQEAAAQmAgBC3ZAYzUw', | ||
gdprApplies: true, | ||
purpose: { | ||
consents: { | ||
0: true, | ||
}, | ||
legitimateInterests: { | ||
0: true, | ||
} | ||
}, | ||
vendor: { | ||
consents: { | ||
00: true, | ||
}, | ||
legitimateInterests: { | ||
0: true, | ||
} | ||
} | ||
}, | ||
rules: [{ | ||
purpose: "storage", | ||
enforcePurpose: true, | ||
enforceVendor: true, | ||
vendorExceptions: ["appnexus"] //Can work without consent for cookies | ||
},{ | ||
purpose: "basicAds", | ||
enforcePurpose: true, | ||
enforceVendor: true, | ||
vendorExceptions: ["appnexus"] | ||
}] | ||
}, | ||
} | ||
}); | ||
}); | ||
|
||
</script> | ||
<script> | ||
var div_1_sizes = [ | ||
[728, 90] | ||
]; | ||
|
||
var PREBID_TIMEOUT = 3500; | ||
var FAILSAFE_TIMEOUT = 4000; | ||
|
||
var adUnits = [ | ||
{ | ||
code: '/19968336/header-bid-tag-0', | ||
mediaTypes: { | ||
banner: { | ||
sizes: div_1_sizes | ||
} | ||
}, | ||
bids: [{ | ||
bidder: 'appnexus', | ||
params: { | ||
placementId: 27445767 | ||
} | ||
}] | ||
} | ||
]; | ||
|
||
// ======== DO NOT EDIT BELOW THIS LINE =========== // | ||
var googletag = googletag || {}; | ||
googletag.cmd = googletag.cmd || []; | ||
googletag.cmd.push(function() { | ||
googletag.pubads().disableInitialLoad(); | ||
}); | ||
|
||
var pbjs = pbjs || {}; | ||
pbjs.que = pbjs.que || []; | ||
|
||
pbjs.que.push(function() { | ||
pbjs.addAdUnits(adUnits); | ||
pbjs.requestBids({ | ||
bidsBackHandler: initAdserver, | ||
timeout: PREBID_TIMEOUT | ||
}); | ||
}); | ||
|
||
function initAdserver() { | ||
if (pbjs.initAdserverSet) return; | ||
pbjs.initAdserverSet = true; | ||
googletag.cmd.push(function() { | ||
pbjs.que.push(function() { | ||
pbjs.setTargetingForGPTAsync(); | ||
googletag.pubads().refresh(); | ||
}); | ||
}); | ||
} | ||
|
||
|
||
// in case PBJS doesn't load | ||
setTimeout(function() { | ||
initAdserver(); | ||
}, FAILSAFE_TIMEOUT); | ||
|
||
googletag.cmd.push(function() { | ||
googletag.defineSlot('/19968336/header-bid-tag-0', div_1_sizes, 'div-1').addService(googletag.pubads()); | ||
googletag.pubads().enableSingleRequest(); | ||
googletag.enableServices(); | ||
}); | ||
|
||
</script> | ||
|
||
<article> | ||
<p> | ||
Module will add key/value pairs in ad calls. | ||
Check out for captify_segments key in the payload sent to Xandr to endpoint https://ib.adnxs.com/ut/v3/prebid : keywords.key[captify_segments] should have an array of string as value. | ||
This array will have Xandr RTSS segment ids. | ||
</p> | ||
</article> | ||
<h2>Basic Prebid.js Example with CaptifyRTD </h2> | ||
<h5>Div-1</h5> | ||
<div id='div-1'> | ||
<script type='text/javascript'> | ||
googletag.cmd.push(function() { | ||
googletag.display('div-1'); | ||
}); | ||
|
||
</script> | ||
</div> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
<!-- | ||
This page calls a single bidder for a single ad slot. It can be considered a "hello world" example for using | ||
Prebid with the Google Publisher Tag. | ||
It also makes a good test page for new adapter PR submissions. Simply set your server's Bid Params object in the | ||
bids array inside the adUnits, and it will use your adapter to load an ad. | ||
NOTE that many ad servers won't send back an ad if the URL is localhost... so you might need to | ||
set an alias in your /etc/hosts file so that you can load this page from a different domain. | ||
--> | ||
|
||
<html> | ||
|
||
<head> | ||
<script type="text/javascript" data-cmp-ab="1" src="https://cdn.consentmanager.net/delivery/semiautomatic.js" | ||
data-cmp-cdid="599af61faf55" data-cmp-host="delivery.consentmanager.net" data-cmp-cdn="cdn.consentmanager.net" data-cmp-codesrc="1"></script> | ||
|
||
|
||
<script async src="../../build/dev/prebid.js"></script> | ||
<script async src="https://www.googletagservices.com/tag/js/gpt.js"></script> | ||
<script> | ||
var FAILSAFE_TIMEOUT = 3300; | ||
var PREBID_TIMEOUT = 1000; | ||
|
||
var adUnits = [{ | ||
code: 'div-gpt-ad-1460505748561-0', | ||
mediaTypes: { | ||
banner: { | ||
sizes: [[300, 250], [300, 600]], | ||
} | ||
}, | ||
// Replace this object to test a new Adapter! | ||
bids: [{ | ||
bidder: 'appnexus', | ||
params: { | ||
placementId: 13144370 | ||
} | ||
}] | ||
|
||
}]; | ||
|
||
var pbjs = pbjs || {}; | ||
pbjs.que = pbjs.que || []; | ||
|
||
</script> | ||
|
||
<script> | ||
var googletag = googletag || {}; | ||
googletag.cmd = googletag.cmd || []; | ||
googletag.cmd.push(function () { | ||
googletag.pubads().disableInitialLoad(); | ||
}); | ||
|
||
pbjs.que.push(function () { | ||
pbjs.addAdUnits(adUnits); | ||
pbjs.setConfig({ | ||
userSync: { | ||
filterSettings: { | ||
iframe: { | ||
bidders: ['appnexus'], | ||
filter: 'include' | ||
} | ||
} | ||
} | ||
}) | ||
pbjs.setConfig({ | ||
consentManagement: { | ||
gpp: { | ||
cmpApi: 'iab', | ||
timeout: 5000 | ||
}, | ||
usp: { | ||
cmpApi: 'static', | ||
consentData: { | ||
getUSPData: { | ||
uspString: '1YYY' | ||
} | ||
} | ||
} | ||
} | ||
}) | ||
pbjs.requestBids({ | ||
bidsBackHandler: sendAdserverRequest, | ||
timeout: PREBID_TIMEOUT | ||
}); | ||
}); | ||
|
||
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(); | ||
}, FAILSAFE_TIMEOUT); | ||
|
||
</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> | ||
<!-- <button onclick="googletag.cmd.push(function () {googletag.pubads().refresh();});">Refresh GAM</button> --> | ||
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!-- start a locally ran server under a different port than 9999 and run gulp serve. | ||
load this page from the local server to properly replicate loading prebid.js within a 3rd party iframe --> | ||
<html> | ||
<head> | ||
<script type="text/javascript" data-cmp-ab="1" src="https://cdn.consentmanager.net/delivery/autoblocking/599af61faf55.js" | ||
data-cmp-host="delivery.consentmanager.net" data-cmp-cdn="cdn.consentmanager.net" data-cmp-codesrc="1"></script> | ||
</head> | ||
<body> | ||
<iframe style="width: 100%; height: 100%;" src="http://test.localhost:9999/integrationExamples/gpt/gpp_us_hello_world_iframe_subpage.html"></iframe> | ||
</body> | ||
</html> | ||
|
Oops, something went wrong.