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.
Add local test page and documentation (prebid#95)
- Loading branch information
1 parent
43e39b5
commit 7d8b667
Showing
3 changed files
with
166 additions
and
1 deletion.
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
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,114 @@ | ||
<!-- This is a Test Page for a Banner End-to-End test --> | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Prebid.js Banner Example</title> | ||
|
||
<!-- Prebid.js --> | ||
<script src="../../build/dist/prebid-debug.js" async=true></script> | ||
|
||
<!-- Google Publisher Tag --> | ||
<script async src="https://www.googletagservices.com/tag/js/gpt.js"></script> | ||
|
||
<script> | ||
var pbjs = pbjs || {}; | ||
pbjs.que = pbjs.que || []; | ||
|
||
// Prebid Banner Ad Unit | ||
const adUnits = [{ | ||
code: 'div-gpt-ad-1460505748561-0', | ||
mediaTypes: { | ||
banner: { | ||
sizes: [[300, 250], [300, 600]] | ||
} | ||
}, | ||
bids: [{ | ||
bidder: 'teads', | ||
params: { | ||
placementId: '1', | ||
pageId: '1', | ||
bidId: '30b31c1838de1e', | ||
bidderRequestId: '465f72576ad9aaf', | ||
timeout: 3000 | ||
} | ||
}] | ||
} | ||
,{ | ||
code: 'div-gpt-ad-1460505748561-1', | ||
mediaTypes: { | ||
banner: { | ||
sizes: [[300, 250], [300, 600]], | ||
} | ||
}, | ||
bids: [{ | ||
bidder: 'teads', | ||
params: { | ||
placementId: '1', | ||
pageId: '1', | ||
bidId: '30b31c1838de1f', | ||
bidderRequestId: '465f72576ad9aaf', | ||
timeout: 3000 | ||
} | ||
}] | ||
} | ||
]; | ||
</script> | ||
|
||
<script> | ||
var googletag = googletag || {}; | ||
googletag.cmd = googletag.cmd || []; | ||
|
||
googletag.cmd.push(function() { | ||
googletag.pubads().disableInitialLoad(); | ||
}); | ||
|
||
pbjs.bidderSettings = { | ||
teads: { | ||
storageAllowed : true | ||
} | ||
}; | ||
|
||
pbjs.que.push(function () { | ||
pbjs.addAdUnits(adUnits); | ||
pbjs.setConfig({ | ||
debug: true, | ||
enableTIDs: true | ||
}); | ||
pbjs.requestBids({ bidsBackHandler: sendAdServerRequest }); | ||
}); | ||
|
||
function sendAdServerRequest() { | ||
googletag.cmd.push(function () { | ||
pbjs.que.push(function () { | ||
pbjs.setTargetingForGPTAsync('div-gpt-ad-1460505748561-0'); | ||
googletag.pubads().refresh(); | ||
}); | ||
}); | ||
} | ||
</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 Banner Ad Unit Test</h2> | ||
<div id='div-gpt-ad-1460505748561-0'> | ||
<script> | ||
googletag.cmd.push(function () { googletag.display('div-gpt-ad-1460505748561-0'); }); | ||
</script> | ||
</div> | ||
<div id="targeting-keys"></div> | ||
</body> | ||
|
||
</html> |