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

Update hello world example and remove other outdated GPT examples #4009

Merged
merged 3 commits into from
Jul 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
33 changes: 11 additions & 22 deletions integrationExamples/gpt/gdpr_hello_world.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<html>
<head>
<script async src="../../build/dev/prebid.js"></script>
<script async src="https://www.googletagservices.com/tag/js/gpt.js"></script>
<script>
(function(window, document) {
if (!window.__cmp) {
Expand Down Expand Up @@ -79,6 +81,7 @@

<script>
var PREBID_TIMEOUT = 700;
var FAILSAFE_TIMEOUT = 2500;

var adUnits = [{
code: 'div-gpt-ad-1460505748561-0',
Expand All @@ -103,7 +106,6 @@

</script>

<script type="text/javascript" src="../../build/dev/prebid.js" async></script>
<script>
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
Expand All @@ -124,7 +126,8 @@
}
});
pbjs.requestBids({
bidsBackHandler: sendAdserverRequest
bidsBackHandler: sendAdserverRequest,
timeout: PREBID_TIMEOUT
});
});

Expand All @@ -139,26 +142,12 @@
});
}

// setTimeout(function() {
// sendAdserverRequest();
// console.log('timeout in main pbjs fired');
// }, 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>
setTimeout(function() {
sendAdserverRequest();
console.log('timeout in main pbjs fired');
}, 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());
Expand All @@ -178,4 +167,4 @@ <h5>Div-1</h5>
</script>
</div>
</body>
</html>
</html>
191 changes: 0 additions & 191 deletions integrationExamples/gpt/gpt_aliasingBidder.html

This file was deleted.

26 changes: 8 additions & 18 deletions integrationExamples/gpt/hello_world.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@

<html>
<head>
<script async src="../../build/dev/prebid.js"></script>
<script async src="https://www.googletagservices.com/tag/js/gpt.js"></script>
<script>
var PREBID_TIMEOUT = 3300;
var FAILSAFE_TIMEOUT = 3300;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 on renaming this, had heard people confused thinking it was bidder timeout and others!

var PREBID_TIMEOUT = 1000;

var adUnits = [{
code: 'div-gpt-ad-1460505748561-0',
Expand All @@ -34,7 +37,6 @@

</script>

<script type="text/javascript" src="../../build/dev/prebid.js" async></script>
<script>
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
Expand All @@ -45,7 +47,8 @@
pbjs.que.push(function() {
pbjs.addAdUnits(adUnits);
pbjs.requestBids({
bidsBackHandler: sendAdserverRequest
bidsBackHandler: sendAdserverRequest,
timeout: PREBID_TIMEOUT
});
});

Expand All @@ -62,23 +65,10 @@

setTimeout(function() {
sendAdserverRequest();
}, PREBID_TIMEOUT);
}, FAILSAFE_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());
Expand All @@ -98,4 +88,4 @@ <h5>Div-1</h5>
</script>
</div>
</body>
</html>
</html>
Loading