Skip to content
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
4 changes: 2 additions & 2 deletions dev-docs/examples/adjust-price.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ about:
- Standard price granularity


jsfiddle_link: jsfiddle.net/prebid/hn06j4f4/11/embedded/html,result
jsfiddle_link: jsfiddle.net/hn06j4f4/21/embedded/html,result

code_height: 2725
code_lines: 125
Expand All @@ -37,7 +37,7 @@ pid: 80
<br><br><br><br>

<div markdown="1">
#### Line 31 to 38: Adjust Bid Price
#### Line 35 to 42: Adjust Bid Price

Some bidders return gross prices, instead of the net prices (what the publisher will actually get paid). For example, a publisher’s net price might be 15% below the returned gross price. In this case, the publisher may want to adjust the bidder’s returned price to run a true header bidding auction. Otherwise, this bidder’s gross price will unfairly win over your other demand sources who report the real price.

Expand Down
2 changes: 1 addition & 1 deletion dev-docs/examples/adunit-refresh.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ about:
- Standard keyword targeting setup
- Standard price granularity
- See a <a href="/examples/adunit_refresh_example.html">Prebid.org-hosted version of the example code here</a>
jsfiddle_link: jsfiddle.net/prebid/dzrs3gfL/75/embedded/html,result
jsfiddle_link: jsfiddle.net/dzrs3gfL/92/embedded/html,result
code_height: 2600
code_lines: 140
pid: 20
Expand Down
24 changes: 12 additions & 12 deletions dev-docs/examples/basic-example.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ about:
- Standard keyword targeting setup (<a href="/dev-docs/publisher-api-reference.html#bidderSettingsDefault">reference</a>).
- Standard price granularity

jsfiddle_link: jsfiddle.net/prebid/bhn3xk2j/458/embedded/html,result
jsfiddle_link: jsfiddle.net/bhn3xk2j/655/embedded/html,result

code_lines: 110
code_height: 2389
Expand All @@ -24,7 +24,7 @@ pid: 10
<br>

<div markdown="1">
##### Line 6 to 27: Define timeout and ad units
##### Line 6 to 39: Define timeout and ad units

This section is the only prebid config you may need to update frequently when:

Expand All @@ -40,7 +40,7 @@ Some publishers put this section of the code into a separate JS file for ad ops

<div markdown="1">

##### Line 8 to 26: Define ad units and bidder tag Ids
##### Line 8 to 39: Define ad units and bidder tag Ids

Register all your ad units in page here. The key `code` is an identifier of this ad unit. If you're using GPT, we recommend putting in that ad unit's slot element ID. If you don't put in the slot element ID, `pbjs.setTargetingForGPTAsync()` would not work, but you can still manually set targeting using `pbjs.getAdserverTargeting()` or `pbjs.getBidResponses()` ([API Reference](/dev-docs/publisher-api-reference.html)).

Expand All @@ -52,15 +52,15 @@ For each ad unit, register the header bidding bidders' tag Ids. For example in t

<div markdown="1">

##### Line 30 and Below: Boilerplate. No Need To Change.
##### Line 44 and Below: Boilerplate. No Need To Change.

</div>

<br>

<div markdown="1">

##### Line 35: Load the Prebid.js library Asynchronously
##### Line 45: Load the Prebid.js library Asynchronously

Generate your version of Prebid.js with the selected adapters [here](http://prebid.org/download.html). Do not use the prebid.js version on the left in your production environment.

Expand All @@ -69,19 +69,19 @@ Generate your version of Prebid.js with the selected adapters [here](http://preb
<br>

<div markdown="1">
##### Line 40: Googletag `disableInitialLoad()`
##### Line 50: Googletag `disableInitialLoad()`

See full documentation from DFP [here](https://developers.google.com/doubleclick-gpt/reference#googletag.PubAdsService_disableInitialLoad).

- Ads will be requested with a `googletag.pubads().refresh()` call. See line 55 in the `sendAdserverRequest()` call.
- Ads will be requested with a `googletag.pubads().refresh()` call. See line 66 in the `sendAdserverRequest()` call.
- This should be set prior to enabling the service.
- GPT's Async mode must be used.

</div>

<div markdown="1">

##### Line 45 to 47: If all requested bids are back early, send out GPT ad request
##### Line 55 to 57: If all requested bids are back early, send out GPT ad request

Prebid.js sends out all registerd bid requests at `pbjs.requestBids()`.
Callback `bidsBackHandler` will be triggered when all bids are back for the requested ad units.
Expand All @@ -92,13 +92,13 @@ Callback `bidsBackHandler` will be triggered when all bids are back for the requ

<div markdown="1">

##### Line 51 to 52: ensure `sendAdserverRequest()` only called once
##### Line 61 to 62: ensure `sendAdserverRequest()` only called once

Send out GPT ad request when all bids are back, or when timeout is hit, whichever comes earlier.

<div markdown="1">

##### Line 55 to 56: Set key-values before GPT `refresh()` to send ad requests to DFP
##### Line 65 to 66: Set key-values before GPT `refresh()` to send ad requests to DFP

This refresh call will trigger GPT to send out the ad request for all the defined ad units on page. It's important to pair this with `disableInitialLoad()`, as in line 40.

Expand All @@ -108,7 +108,7 @@ Call `pbjs.setTargetingForGPTAsync()` before the refresh call to let prebid.js a

<div markdown="1">

##### Line 61 to 63: set timeout to timebox bidders' bids
##### Line 71 to 73: set timeout to timebox bidders' bids

The page will only asynchronously wait for PREBID_TIMEOUT amount of time before it calls `sendAdserverRequest()` to let GPT send out the bids.

Expand All @@ -118,7 +118,7 @@ The page will only asynchronously wait for PREBID_TIMEOUT amount of time before

<div markdown="1">

##### Line 68 and below: your original page setup unchanged.
##### Line 78 and below: your original page setup unchanged.

You don't have to change any other part of your page, such as GPT loading or GPT tags definition.

Expand Down
2 changes: 1 addition & 1 deletion dev-docs/examples/brightcove-example.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ player_notes:
- For this demo we'll be configuring the player's ima3 settings on the page instead of in Video Cloud. Make sure you load the ima3 script and CSS file in addition to your player script.
- On the publish page for the player, choose the <b>Advanced</b> embed code (not <b>Standard</b>).
- If you're playing a preroll ad, do not include the videoID in the video element.
jsfiddle_link: jsfiddle.net/prebid/dd4wd8z7/32/embedded/html/
jsfiddle_link: jsfiddle.net/dd4wd8z7/36/embedded/html/
demo_link: prebid.org/examples/video/bc-demo.html
code_lines: 154
code_height: 4600
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ about:
- Integration with DFP's GPT single request asynchronous mode
- One set of line items for all bidders

jsfiddle_link: jsfiddle.net/prebid/bp9magow/100/embedded/html,result
jsfiddle_link: jsfiddle.net/qhdnvdhj/2/embedded/html,result
code_height: 3166
code_lines: 146
pid: 101
Expand All @@ -30,7 +30,7 @@ pid: 101

<div markdown="1">

#### Line 32 to 63: Set Custom Price Granularity
#### Line 40 to 71: Set Custom Price Granularity

In this example, we customize the bid price to use our own custom logic. The logic is:

Expand All @@ -50,10 +50,10 @@ To see the effect of this customization, click into the **Result** tab of this J
<br /><br /><br /><br /><br /><br />

<div markdown="1">
#### Line 87 to 90: Set targeting with custom keywords
#### Line 97 to 100: Set targeting with custom keywords

`pbjs.setTargetingForGPTAsync()` will now use your custom keywords for targeting.

The keywords can be retrieved by calling `pbjs.getAdserverTargeting()` as shown on line 91.
The keywords can be retrieved by calling `pbjs.getAdserverTargeting()` as shown on line 100.

</div>
2 changes: 1 addition & 1 deletion dev-docs/examples/custom-price-bucket.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ about:
- Integration with DFP's GPT single request asynchronous mode
- One set of line items for all bidders

jsfiddle_link: jsfiddle.net/prebid/bp9magow/87/embedded/html,result
jsfiddle_link: jsfiddle.net/46rttaqv/2/embedded/html,result
code_height: 3166
code_lines: 146

Expand Down
4 changes: 2 additions & 2 deletions dev-docs/examples/full-page-refresh.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ about:
- Standard keyword targeting setup (<a href="/dev-docs/publisher-api-reference.html#bidderSettingsDefault">reference</a>)
- Standard price granularity

jsfiddle_link: jsfiddle.net/prebid/amg49spy/18/embedded/html,result
jsfiddle_link: jsfiddle.net/amg49spy/21/embedded/html,result
code_height: 2662
code_lines: 122

Expand All @@ -29,7 +29,7 @@ pid: 35
<br><br><br><br>

<div markdown="1">
#### Line 31 to 41: Refresh bids listener
#### Line 92 to 102: Refresh bids listener

The refresh button triggers this function call. `pbjs.requestBids` will set keyword targeting and refresh the DFP ad units when:

Expand Down
2 changes: 1 addition & 1 deletion dev-docs/examples/jw-cloud-example.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ player_notes:
- No matter what embedding method you choose to use, you must follow the <b>custom embed</b> instructions. You cannot use the single-line embed.
- If you're using a cloud-hosted player, <b>do not enable advertising in the platform</b>. We'll do it on page so that we can use the vast url from prebid.
- You can set up most of your player's settings in the platform. The platform settings will be used unless overridden on the page in the setup call.
jsfiddle_link: jsfiddle.net/prebid/zt70zj9z/11/embedded/html/
jsfiddle_link: jsfiddle.net/zt70zj9z/21/embedded/html/
demo_link: prebid.org/examples/video/jwPlatformPrebidDemo.html
code_lines: 137
code_height: 3540
Expand Down
2 changes: 1 addition & 1 deletion dev-docs/examples/jw-selfhost-example.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ player_notes:
- For this example we will be using <a href="https://support.jwplayer.com/customer/portal/articles/1406723-mp4-video-embed#fndtn-method-3">method 3</a>, a self-hosted player with JW Platform hosted content.
- To see an example using the cloud-hosted player, see <a href="/dev-docs/examples/jw-cloud-example.html">Show a Video Ad in a Cloud Hosted JW Player</a>.
- No matter what embedding method you choose to use, you must follow the <b>custom embed</b> instructions. You cannot use the single-line embed.
jsfiddle_link: jsfiddle.net/prebid/357yaqgc/29/embedded/html/
jsfiddle_link: jsfiddle.net/357yaqgc/32/embedded/html/
demo_link: prebid.org/examples/video/jwPlayerPrebid.html
code_lines: 141
code_height: 3600
Expand Down
2 changes: 1 addition & 1 deletion dev-docs/examples/kaltura-example.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ player_notes:
- In <a href="https://knowledge.kaltura.com/universal-studio-information-guide">Kaltura Studio</a>, enable the advertising plugin you want to use. For this demo we'll be using the VAST 3.0 plugin.
- We'll be using the <a href="http://player.kaltura.com/docs/kwidget">Dynamic Embed</a> method to add the player to the page. We need to customize the player on the page, so the auto embed method will not work.
- To find the <a href="http://player.kaltura.com/docs/kwidget">Dynamic Embed</a> code for your player, go to the <b>content</b> tab in <a href="https://knowledge.kaltura.com/universal-studio-information-guide">Kaltura Studio</a> and select the <b>Preview and Embed</b> action. Click <b>Show Advanced Options</b> to see more embedding options, and select <b>Dynamic Embed</b> from the dropdown menu.
jsfiddle_link: jsfiddle.net/prebid/17vap1ro/8/embedded/html/
jsfiddle_link: jsfiddle.net/17vap1ro/11/embedded/html/
demo_link: prebid.org/examples/video/klt-demo.html
code_lines: 139
code_height: 4000
Expand Down
2 changes: 1 addition & 1 deletion dev-docs/examples/ooyala-example.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ about:
player_notes:
- This guide uses the V4 Ooyala player. To get the embed code for the V4 player, select <b>New Ooyala Player (V4) Embed Code</b> in the embed options instead of HTML Embed Code.
- Do not select an ad set in the 'Monetize' tab. We'll control that setting on the page (see example code below).
jsfiddle_link: jsfiddle.net/prebid/hxzue5eu/9/embedded/html/
jsfiddle_link: jsfiddle.net/hxzue5eu/12/embedded/html/
demo_link: prebid.org/examples/video/ooyala-demo.html
code_lines: 154
code_height: 5000
Expand Down
4 changes: 2 additions & 2 deletions dev-docs/examples/outstream-video-example.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ about:
- Other than setting up the ad unit, very little change from standard Prebid for engineering
- No changes in ad ops setup; use standard Prebid creatives
- Must have demand from video-enabled bidder adapters
- <em>Note</em> - this example only works sporadically in the embedded JSFiddle below - try <a href="http://jsfiddle.net/prebid/e9bb94L6/2/">running it from JSFiddle.net directly</a>
- <em>Note</em> - this example only works sporadically in the embedded JSFiddle below - try <a href="http://jsfiddle.net/prebid/e9bb94L6/9/">running it from JSFiddle.net directly</a>
- See also the following examples hosted on Prebid.org - <a href="/examples/video/outstream/outstream-dfp-two-adapters-demo.html">Show an outstream ad using Unruly and AppNexus</a>, and <a href="/examples/video/outstream/outstream-no-adserver-demo.html">Show an outstream ad without an ad server</a>
- For more information, including links to more outstream examples, see <a href="/dev-docs/show-outstream-video-ads.html">Show Outstream Video Ads</a>
jsfiddle_link: jsfiddle.net/prebid/e9bb94L6/2/embedded/html,result
jsfiddle_link: jsfiddle.net/e9bb94L6/10/embedded/html,result
use_old_example_style: false
code_lines: 110
code_height: 3400
Expand Down
2 changes: 1 addition & 1 deletion dev-docs/examples/send-all-bids.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ about:
- Standard price granularity
- Standard integration with DFP's GPT single request asynchronous mode

jsfiddle_link: jsfiddle.net/prebid/qu68xoz5/60/embedded/html,result
jsfiddle_link: jsfiddle.net/qu68xoz5/71/embedded/html,result

code_lines: 121
code_height: 2641
Expand Down
4 changes: 2 additions & 2 deletions dev-docs/examples/simplified-price-bucket-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ hide: true
about:
- Simplified price bucket setup with one function call to <a href="/dev-docs/publisher-api-reference.html#module_pbjs.setPriceGranularity"><code>pbjs.setPriceGranularity()</code></a>

jsfiddle_link: jsfiddle.net/prebid/bp9magow/98/embedded/html,result
jsfiddle_link: jsfiddle.net/bp9magow/129/embedded/html,result
code_height: 2641
code_lines: 121

Expand Down Expand Up @@ -47,7 +47,7 @@ pid: 25
<br />

<div markdown="1">
#### Line 32: Set price granularity
#### Line 41: Set price granularity

The simplest way to set price granularity is to use the helper method [`pbjs.setPriceGranularity`](/dev-docs/publisher-api-reference.html#module_pbjs.setPriceGranularity). For more information about this method, see [its documentation](/dev-docs/publisher-api-reference.html#module_pbjs.setPriceGranularity).

Expand Down
4 changes: 2 additions & 2 deletions dev-docs/examples/size-mapping.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ hide: true
about:
- Example showing how to configure ad units to resize dynamically based on screen size

jsfiddle_link: jsfiddle.net/prebid/58udrja1/31/embedded/html,result
jsfiddle_link: jsfiddle.net/58udrja1/61/embedded/html,result

code_height: 3000
code_lines: 118
Expand All @@ -21,7 +21,7 @@ pid: 102

<div markdown="1">

#### Line 8: Add size mapping to the ad unit
#### Line 13: Add size mapping to the ad unit

You can use the ad unit's new `sizeMapping` property to declaratively specify the ad sizes that should be shown when the device screen is greater than or equal to a given size.

Expand Down
2 changes: 1 addition & 1 deletion dev-docs/examples/use-prebid-with-appnexus-ad-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ about:
- An example showing how to use Prebid.js with AppNexus Publisher Ad Server
- ... including how to use the <a href="https://wiki.appnexus.com/x/JAUIBQ">AppNexus Seller Tag</a>

jsfiddle_link: jsfiddle.net/prebid/gqvoj5pk/embedded/html,result
jsfiddle_link: jsfiddle.net/gqvoj5pk/36/embedded/html,result
code_lines: 120
code_height: 2850
use_old_example_style: false
Expand Down
2 changes: 1 addition & 1 deletion dev-docs/examples/videojs-example.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ about:
player_notes:
- Make sure to incude at least one advertising plugin you want to use on the page. For this demo, we're using the <a href="https://github.com/MailOnline/videojs-vast-vpaid">Mail Online VAST/VPAID plugin</a>.
- A guide to the options the <code>vastClient</code> accepts can be found <a href="https://github.com/MailOnline/videojs-vast-vpaid#options">here</a>.
jsfiddle_link: jsfiddle.net/prebid/vfzo8ofu/13/embedded/html/
jsfiddle_link: jsfiddle.net/vfzo8ofu/19/embedded/html/
demo_link: prebid.org/examples/video/videojs-demo.html
code_lines: 159
code_height: 4000
Expand Down
2 changes: 1 addition & 1 deletion dev-docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The easiest way to get started with Prebid.js is to use the example code below.

{% include dev-docs/build-from-source-warning.md %}

<iframe width="100%" height="680" src="//jsfiddle.net/prebid/qu68xoz5/66/embedded/html,result" allowfullscreen="allowfullscreen" frameborder="0"></iframe>
<iframe width="100%" height="680" src="//jsfiddle.net/prebid/e48yrvby/1/embedded/html,result" allowfullscreen="allowfullscreen" frameborder="0"></iframe>

### Next Steps

Expand Down
8 changes: 6 additions & 2 deletions examples/adunit_refresh_example.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@

var adUnits = [{
code: 'div-gpt-ad-1438287399331-0',
sizes: [[300, 250], [300, 600]],
mediaTypes: {
banner: {
sizes: [[300, 250], [300, 600]],
}
},
bids: [{
bidder: 'appnexus',
params: { placementId: '10433394' }
Expand All @@ -30,7 +34,7 @@
<!-- Prebid Config Section END -->

<!-- Prebid Boilerplate Section START. No Need to Edit. -->
<script type="text/javascript" src="//acdn.adnxs.com/prebid/not-for-prod/prebid.js" async></script>
<script type="text/javascript" src="//acdn.adnxs.com/prebid/not-for-prod/1/prebid.js" async></script>
<script>
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
Expand Down