Skip to content

Commit

Permalink
updated all examples to dfp instant load
Browse files Browse the repository at this point in the history
  • Loading branch information
Heray committed Jun 11, 2016
1 parent df97ce4 commit 6f70b07
Show file tree
Hide file tree
Showing 22 changed files with 943 additions and 265 deletions.
6 changes: 4 additions & 2 deletions _includes/dev-docs/build-from-source-warning.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
{: .bg-warning :}
This example uses a test version of Prebid.js hosted on our CDN that is not recommended for production use. It includes all available adaptors. Production implementations should build from source or customize the build using the [Download](http://prebid.org/download.html) page to make sure only the necessary bidder adaptors are included.

<div class="bg-warning">
This example uses a test version of Prebid.js hosted on our CDN that is not recommended for production use. It includes all available adaptors. Production implementations should build from source or customize the build using the <a href="http://prebid.org/download.html">Download</a> page to make sure only the necessary bidder adaptors are included.
</div>
5 changes: 4 additions & 1 deletion _layouts/example.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ <h5>All Examples</h5>

<ul id="example-tab">

{% assign example_pages = (site.pages | where: "layout", "example") %}
{% assign example_pages = (site.pages | where: "layout", "example") | sort: "pid" %}

{% for epage in example_pages %}
<li>
Expand Down Expand Up @@ -112,6 +112,9 @@ <h4>How to use this:</h4>

<div class="col-sm-6">


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

{{content}}

</div>
Expand Down
124 changes: 124 additions & 0 deletions _layouts/example_old.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
{% include head.html %}

{% include main_nav.html %}

<div class="container bs-docs-container">



<div class="row">


<div class="col-md-5">

<div class="docs-sidebar">

<div class="row">
<div class="col-md-6">
{% include left_nav.html %}
</div>

<div class="col-md-6">
<h5>Old Examples</h5>

<ul id="example-tab">

{% assign example_pages = (site.pages | where: "layout", "example_old") %}

{% for epage in example_pages %}
<li>
<a href="{{ epage.url }}">{{ epage.title }}</a>
{% if epage.is_beta %}
<span class="label label-warning">Beta</span>
{% endif %}
</li>
{% endfor %}

</ul>
<!-- </div> -->
</div>
</div>
</div>
</div>


<div class="col-md-7" role="main">

<div class="bs-docs-section" markdown="1">

<h1>(OLD) {{ page.description }} </h1>

{% if page.why_link %}
<h4>Who should use this example:</h4>

<ul>
<li>Please refer to the <a href="{{page.why_link}}" target="_blank">product feature launch notes</a>.</li>
</ul>
{% endif %}

<h4>This page contains:</h4>

<ul>
{% for about_bullet in page.about %}
<li>{{ about_bullet}}</li>
{% endfor %}
</ul>


<h4>How to use this:</h4>

Click on the JSFiddle "Result" tab to see the result. Or, edit it in JSFiddle.

</div>
</div>






</div>

<br>

<div class="row">

<div class="col-sm-6">


<table class="jsfiddle-line-number">
<tr>
<td class="line-number">

{% for num in (1...{{page.code_lines}}) %}

{{ num }} <br>

{% endfor %}

</td>

<td>


<iframe width="100%" height="{{page.code_height}}" src="//{{page.jsfiddle_link}}" allowfullscreen="allowfullscreen" frameborder="0"></iframe>

</td>
</tr>
</table>


</div>

<div class="col-sm-6">

{{content}}

</div>

</div>

</div>


{% include foot.html %}
4 changes: 4 additions & 0 deletions _posts/2016-04-20-extremely-simplified-price-bucket-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ permalink: /blog/extremely-simplified-price-bucket-setup
| cpm > 5 and < 10 | .10 increments |
| cpm > 10 and < 20 | .50 increments |
| cpm > 20 | pb capped at 20 |

### How to implement it?

Please follow the line by line code example [documented here](/dev-docs/examples/simplified-price-bucket-setup.html).
4 changes: 2 additions & 2 deletions _posts/2016-05-10-dfp-instant-load.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ permalink: /blog/dfp-instant-load

---

Prebid is introducing a new way of loading GPT and sending GPT requests. Compared to the [previous mechanism](/dev-docs/examples/basic-example.html), the new method has the below advantages.
Prebid is introducing a new way of loading GPT and sending GPT requests. Compared to the [previous mechanism](/dev-docs/examples-old/basic-example.html), the new method has the below advantages.

<br>

Expand Down Expand Up @@ -51,7 +51,7 @@ pbjs.requestBids({

#### How to implement it?

Please follow the line by line code example [documented here](/dev-docs/examples/instant-load.html).
Please follow the line by line code example [documented here](/dev-docs/examples/basic-example.html).

<br>

Expand Down
61 changes: 61 additions & 0 deletions dev-docs/examples-old/adjust-price.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
layout: example_old
title: Adjust Price
description: Adjust Price Example with DFP GPT

top_nav_section: dev_docs
nav_section: quick-start

hide: true

about:
- <strong>Adjust bidder price for real earnings.</strong>
- Integration with DFP's GPT single request asynchronous mode.
- One set of line items for all bidders
- Standard keyword targeting setup (<a href="/dev-docs/publisher-api-reference.html#bidderSettingsDefault">reference</a>).
- Standard price granularity (pbMg see <a href="/dev-docs/publisher-api-reference.html#bidResponse">reference here</a>).


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

code_height: 2536
code_lines: 116

pid: 80
---

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

<br>
<br>
<br>
<br>
<br>

<div markdown="1">
#### Line 1 to 58: Set timeout and define ad units

Same setup as in [Basic Example](/dev-docs/examples/basic-example.html). Check the basic example page for more details.

</div>

<br><br><br><br><br><br>
<br><br><br><br><br><br>
<br><br><br><br><br><br>
<br><br><br><br><br><br>
<br><br><br><br><br><br>
<br><br><br><br><br><br>
<br><br><br><br><br><br>
<br><br><br><br><br><br>
<br><br><br><br><br><br>

<div markdown="1">
#### Line 62 to 64: 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.

(AppNexus does return the net price. This is just an example for adjusting bid prices.)

In the example, the AOL bidder will inherit from "standard" adserverTargeting keys (default and not shown), so that you don't have to define the targeting keywords again.

</div>
66 changes: 66 additions & 0 deletions dev-docs/examples-old/adunit-refresh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
layout: example_old
title: Ad Unit Refresh
description: Individual Ad Unit Refresh Example with DFP GPT

top_nav_section: dev_docs
nav_section: quick-start

hide: true

about:
- Ability to <strong>refresh individual ad units</strong>. Useful for infinite scrolling ad slots.
- Integration with DFP's GPT single request asynchronous mode.
- One set of line items for all bidders
- Standard keyword targeting setup (<a href="/dev-docs/publisher-api-reference.html#bidderSettingsDefault">reference</a>).
- Standard price granularity (pbMg see <a href="/dev-docs/publisher-api-reference.html#bidResponse">reference here</a>).

jsfiddle_link: jsfiddle.net/prebid/dzrs3gfL/5/embedded/html,result
code_height: 2893
code_lines: 133

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

<br>
<br>
<br>
<br>
<br>

<div markdown="1">
#### Line 1 to 58: Set timeout and define ad units

Same setup as in [Basic Example](/dev-docs/examples/basic-example.html). Check the basic example page for more details.

</div>

<br><br><br><br><br><br>
<br><br><br><br><br><br>
<br><br><br><br><br><br>
<br><br><br><br><br><br>
<br><br><br><br><br><br>
<br><br><br><br><br><br>
<br><br><br><br><br><br>
<br><br><br><br><br><br>
<br><br><br><br><br><br>
<br><br><br><br><br><br>
<br><br><br><br><br><br>
<br><br><br><br><br><br>
<br><br><br><br><br><br>
<br><br><br><br>



<div markdown="1">
#### Line 86 to 97: Refresh bids listener

The refresh button for each ad unit triggers its corresponding function call. `pbjs.requestBids` can request bids for only selected ad units. The call will set keyword targeting and refresh the DFP ad units when:

- All bids for all ad units came back, or
- PREBID_TIMEOUT set in the `timeout` parameter is hit.

See `pbjs.requestBids` [reference](/dev-docs/publisher-api-reference.html#module_pbjs.requestBids) for more details.

</div>
Loading

0 comments on commit 6f70b07

Please sign in to comment.