Skip to content

Basic example with debugging module instead of AppNexus placement #5995

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
12 changes: 9 additions & 3 deletions dev-docs/examples/basic-example.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ pid: 10

## Basic Prebid.js Example

{% capture htmlCodePrebid %}<h5>Div-1</h5>
{% capture htmlCodePrebid %}
<!-- DO NOT add this script in prod -->
<script src="intercept-banner-not-for-prod.js" ></script>
<!-- END -->

<h5>Div-1</h5>
<div id='div-1' style="min-height:250px;">
<script type='text/javascript'>
googletag.cmd.push(function() {
Expand All @@ -26,7 +31,8 @@ pid: 10
</div>
{% endcapture %}

{% capture jsCode %}var sizes = [
{% capture jsCode %}
var sizes = [
[300, 250]
];
var PREBID_TIMEOUT = 700;
Expand All @@ -41,7 +47,7 @@ var adUnits = [{
bids: [{
bidder: 'appnexus',
params: {
placementId: 13144370
placementId: 'XXXXXXX' //not used in prod
}
}]
}];
Expand Down
16 changes: 16 additions & 0 deletions dev-docs/examples/intercept-banner-not-for-prod.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
window.pbjs = window.pbjs || { que: [] };
pbjs.que.push(() => {
pbjs.setConfig({
debugging: {
enabled: true,
intercept: [{
when: {
bidder: 'appnexus',
},
then: {
ad: '<html><body><img src="https://vcdn.adnxs.com/p/creative-image/27/c0/52/67/27c05267-5a6d-4874-834e-18e218493c32.png" width="300" height="250" /></body></html>'
Copy link
Contributor

Choose a reason for hiding this comment

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

We can self host those images as well

Copy link
Contributor

Choose a reason for hiding this comment

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

For the record, Bret has made those vivid test creatives long before genAi was a thing

}
}]
}
})
})