Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/prebid/master'
Browse files Browse the repository at this point in the history
# Conflicts:
#	download.md
  • Loading branch information
Mordhak committed Mar 6, 2017
2 parents f3f1005 + 07ce9fd commit 099edc2
Show file tree
Hide file tree
Showing 65 changed files with 1,660 additions and 414 deletions.
24 changes: 24 additions & 0 deletions _includes/example_tab.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<h5>All Examples</h5>

<ul id="example-tab">

{% assign example_pages = (site.pages | where: "layout", "example") | sort: "pid" %}
{% 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 %}
<br>
{% assign pl_example_pages = (site.pages | where: "layout", "player_example" | sort: "pid" %}
{% for p_epage in pl_example_pages %}
<li>
<a href="{{ p_epage.url }}">{{ p_epage.title }}</a>
{% if p_epage.is_beta %}
<span class="label label-warning">Beta</span>
{% endif %}
</li>
{% endfor %}
</ul>
4 changes: 2 additions & 2 deletions _includes/foot.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-66025807-1', 'auto');
ga('create', 'UA-90624301-1', 'auto');
ga('send', 'pageview');

</script>


</body>
</html>
</html>
1 change: 0 additions & 1 deletion _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
}
</style>

<script type="text/javascript" src="http://www.parsecdn.com/js/parse-1.5.0.min.js"></script>
<!-- <script src="http://code.jquery.com/jquery-1.11.2.min.js"></script> -->
<script src="{{site.github.url}}/assets/js/jquery.min.js"></script>
<!-- <script src="http://netdna.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script> -->
Expand Down
2 changes: 1 addition & 1 deletion _includes/live_demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<div class="col-sm-6 col-xs-6 pb-sm-left">
<script>function refresh_iframe_ad() {
$('#demo-iframe').contents()[0].location.reload();
$('#chart_div').html('<img src="/assets/images/loader.gif">');
$('#chart_div').html('<img alt="loader gif" src="/assets/images/loader.gif">');
return false;
}
</script>
Expand Down
21 changes: 3 additions & 18 deletions _layouts/example.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,9 @@
</div>

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

<ul id="example-tab">

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

{% 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>
{% include example_tab.html %}
<!-- </div> -->
</div>
</div>
</div>
</div>
</div>
Expand Down Expand Up @@ -67,7 +52,7 @@ <h4>This page contains:</h4>
</p>

<p>
For tips and troublshooting info, see:
For tips and troubleshooting info, see:
<ul>
<li>
<a href="{{site.github.url}}/dev-docs/toubleshooting-tips.html">Tips for Troubleshooting</a>
Expand Down
125 changes: 125 additions & 0 deletions _layouts/player_example.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
{% 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">
{% include example_tab.html %}
<!-- </div> -->
</div>
</div>
</div>
</div>

<div class="col-md-7" role="main">
<div class="bs-docs-section" markdown="1">

<h1>{{ 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 %}
<p>This page is an example of using prebid video with a specific player. For a general guide to using video in prebid, click <a href="{{site.github.url}}/dev-docs/show-video-with-a-dfp-video-tag.html">here.</a></p>
<br>

<h4>This page contains:</h4>

<p>
<ul>
{% for about_bullet in page.about %}
<li>{{ about_bullet}}</li>
{% endfor %}
</ul>
</p>
<br>
<h4>Player specific notes:</h4>
<p>
<ul>
{% for player_bullet in page.player_notes %}
<li>{{ player_bullet}}</li>
{% endfor %}
</ul>
</p>
<br>
<p>

Click <a href="//{{page.demo_link}}">here</a> to view a demo page with this example. Click <strong>Edit in JSFiddle</strong> to open the example in a new tab.

</p>

<p>
For tips and troublshooting info, see:
<ul>
<li>
<a href="{{site.github.url}}/dev-docs/toubleshooting-tips.html">Tips for Troubleshooting</a>
</li>
<li>
<a href="{{site.github.url}}/dev-docs/common-issues.html">Common Issues</a>
</li>
</ul>
</p>

</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">


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

{{content}}

</div>
<br><br>

</div>

</div>


{% include foot.html %}
7 changes: 5 additions & 2 deletions _posts/2015-08-07-bidder-analysis.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ permalink: /blog/header-bidding-bidder-analysis

---

{: .alert.alert-warning :}
The content on this page is from 2015 and is now obsolete.

While implementing Prebid.js' adaptors for different bidders, we've noticed not all bidders return exact price to the publisher's page. Different bidders also have vastly different response latency. We hope the analysis here can help you make smart decisions when implementing header bidding.

<!--| Amazon | Estimated at $0.50 increment | 300ms | -->
Expand All @@ -28,12 +31,12 @@ While implementing Prebid.js' adaptors for different bidders, we've noticed not

*Note that the above latency estimate was done in New York, US with fast Internet connection. To provide more accurate report, publishers can implement latency trackers through the prebid.js API.

###Live Test:
### Live Test

{% include live_demo.html %}

#### The above ad is auctioned with Prebid.js.

* **Hover over** the timeline bars to discover how long each bidder takes.
* Ad server is set to only wait for **up to 400ms**. If all bidders respond faster than that, Prebid.js will load the ad server early. If not, Prebid.js will ignore bidders that took too long.
* You may notice Javascript cannot initiate all bidder calls at once. To prevent bidders that get installed last to always have less time to respond, Prebid.js helps you keep the auction fair and rotate the order that bidders get called.
* You may notice Javascript cannot initiate all bidder calls at once. To prevent bidders that get installed last to always have less time to respond, Prebid.js helps you keep the auction fair and rotate the order that bidders get called.
2 changes: 1 addition & 1 deletion adops/deals.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Whether your Ad Ops setup [sends all bids to the ad server](/adops/send-all-bids

### Step 2: Create Key-values

For each header bidding partner you work with, create a keyword in the format of `hb_deal_BIDDERCODE`, e.g., `hb_deal_pubmatic`. For more examples of the keyword format, see the [API Reference for `pbjs.getAdserverTargeting`](#module_pbjs.getAdserverTargeting).
For each header bidding partner you work with, create a keyword in the format of `hb_deal_BIDDERCODE`, e.g., `hb_deal_pubmatic`. For more examples of the keyword format, see the [API Reference for `pbjs.getAdserverTargeting`]({{site.github.url}}/dev-docs/publisher-api-reference.html#module_pbjs.getAdserverTargeting).

Note that due to [DFP's character length limit on keys](https://support.google.com/dfp_premium/answer/1628457?hl=en#Key-values), Index Exchange's key is truncated to `hb_deal_indexExchang`.
<br>
Expand Down
7 changes: 6 additions & 1 deletion assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,12 @@ table.jsfiddle-line-number .line-number {
margin-bottom: 6px;
}

table {
table:not(.jsfiddle-line-number) {
table-layout: fixed;
word-wrap: break-word;
}

div.pl-doc-entry{
position: absolute;
}

Binary file modified dev-docs/.DS_Store
Binary file not shown.
37 changes: 26 additions & 11 deletions dev-docs/bidder-adaptor.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ At a high level, a bidder adapter is responsible for:

This page has instructions for writing your own bidder adapter. The instructions here try to walk you through some of the code you'll need to write for your adapter. When in doubt, use [the working adapters in the Github repo](https://github.com/prebid/Prebid.js/tree/master/src/adapters) for reference.

{: .alert.alert-success :}
**Adding a Video Bidder Adaptor?**
See [How to Add a New Video Bidder Adaptor]({{site.github.url}}/dev-docs/how-to-add-a-new-video-bidder-adaptor.html).

* TOC
{:toc}

Expand All @@ -29,7 +33,7 @@ In your PR to add the new adapter, please provide the following information:

- The contact email of the adapter's maintainer.
- A test ad unit that will consistently return test creatives. This helps us to ensure future Prebid.js updates do not break your adapter.

- Any other information listed as required in [CONTRIBUTING.md](https://github.com/prebid/Prebid.js/blob/master/CONTRIBUTING.md).

## Step 2: Add a new bidder JS file

Expand Down Expand Up @@ -57,15 +61,12 @@ module.exports = BidderNameAdapter;

A good example of an adapter that uses this pattern for its implementation is [OpenX](https://github.com/prebid/Prebid.js/blob/master/src/adapters/openx.js).


## Step 3: Design your bid params

Use the `bid.params` object for defining the parameters of your ad request. At a minimum, you should include the tag ID and the site ID. You can also include ad sizes, keywords, and other data, such as video bidding information.
Use the `bid.params` object for defining the parameters of your ad request. You can include tag ID, site ID, ad size, keywords, and other data, such as [video bidding information]({{site.github.url}}/dev-docs/how-to-add-a-new-video-bidder-adaptor.html).

For more information about the kinds of information that can be passed using these parameters, see [the list of bidder parameters]({{site.github.url}}/dev-docs/bidders.html).

For example, if your bidder supports serving video ads, you could add a `video` object to your adapter's bid parameters like the [AppNexus AST adapter]({{site.github.url}}/dev-docs/bidders.html#appnexusAst). To see how those video params are processed and added to the ad tag, see [the AST adapter's implementation of the `callBids` function](https://github.com/prebid/Prebid.js/blob/master/src/adapters/appnexusAst.js).

For more information about how the implementation of `callBids` should work generally, see the next section.


Expand Down Expand Up @@ -123,11 +124,22 @@ When the bid response(s) are available, notify Prebid.js immediately, so that yo

To register the bid, call the `bidmanager.addBidResponse(adUnitCode, bidObject)` function. To register multiple bids, call the function multiple times.

* If the bid is valid, use `bidfactory.createBid(1)` to create the `bidObject`. A status of `1` means the bid is valid. For details about the status codes, see [constants.json](https://github.com/prebid/Prebid.js/blob/master/src/constants.json).
* If the bid is invalid (no fill or error), use `bidfactory.createBid(2)` to create the `bidObject`. A status of `2` means "no bid".
If the bid is valid, create the bid response as shown below, matching the bid request/response pair. A status of `1` means the bid response is valid. For details about the status codes, see [constants.json](https://github.com/prebid/Prebid.js/blob/master/src/constants.json).

{% highlight js %}
var utils = require('../utils.js');
var bidfactory = require('../bidfactory.js');

var bidRequest = utils.getBidRequest(id);
var bidResponse = bidfactory.createBid(1, bidRequest);
{% endhighlight %}

If the bid is invalid (no fill or error), create the `bidObject` as shown below. A status of `2` means "no bid".

{: .alert.alert-info :}
If your bidder supports serving video ads, it needs to provide a VAST video URL in its response. On the adapter side, your implementation of `createBid` needs to add the VAST URL to the bid. For an example implementation, see the implementation in the [AST adapter](https://github.com/prebid/Prebid.js/blob/master/src/adapters/appnexusAst.js).
{% highlight js %}
var bidRequest = utils.getBidRequest(id);
var bidResponse = bidfactory.createBid(2, bidRequest);
{% endhighlight %}

Example:

Expand All @@ -138,7 +150,8 @@ Example:
// the bidder API's ad response unit that has info like CPM, creative content
var adUnit;

var bidObject = bidfactory.createBid(1);
var bidRequest = utils.getBidRequest(id);
var bidObject = bidfactory.createBid(1, bidRequest);
bidObject.bidderCode = 'openx';
bidObject.cpm = Number(adUnit.get('pub_rev')) / 1000;
bidObject.ad = adUnit.get('html');
Expand All @@ -149,7 +162,7 @@ bidObject.height = adUnit.get('height');
bidmanager.addBidResponse(adUnitCode, bidObject);

// invalid bid response
bidObject = bidfactory.createBid(2);
bidObject = bidfactory.createBid(2, bidRequest);
bidObject.bidderCode = 'openx';
bidmanager.addBidResponse(adUnitCode, bidObject);

Expand Down Expand Up @@ -185,6 +198,8 @@ For usage examples, see [the working adapters in the repo](https://github.com/pr

## Further Reading

+ [How to Add a New Video Bidder Adaptor]({{site.github.url}}/dev-docs/how-to-add-a-new-video-bidder-adaptor.html)

+ [The bidder adapter sources in the repo](https://github.com/prebid/Prebid.js/tree/master/src/adapters)

</div>
4 changes: 2 additions & 2 deletions dev-docs/bidders.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ These parameters in the `bidReponse` object are common across all bidders.
| Name | Type | Description | Example
| :---- |:--------| :-------| :-------|
| `bidder` | String | The bidder code. Used by ad server's line items to identify bidders | `appnexus` |
| `adId` | String | The unique identifier of a bid creative. It's used by the line item's creative as in [this example](adops.html#creative-setup). | `123` |
| `adId` | String | The unique identifier of a bid creative. It's used by the line item's creative as in [this example]({{site.github.url}}/adops/send-all-bids-adops.html#step-3-add-a-creative). | `123` |
| `pbLg` | String | The low granularity price bucket at 0.50 increment, capped at $5, floored to 2 decimal places. (0.50, 1.00, 1.50, ..., 5.00) | `1.50` |
| `pbMg` | String | The medium granularity price bucket at 0.10 increment, capped at $20, floored to 2 decimal places. (0.10, 0.20, ..., 19.90, 20.00) | `1.60` |
| `pbHg` | String | The high granularity price bucket at 0.01 increment, capped at $20, floored to 2 decimal places. (0.01, 0.02, ..., 19.99, 20.00) | `1.61` |
Expand All @@ -66,7 +66,7 @@ These parameters in the `bidReponse` object are common across all bidders.

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

<h1><a name="{{ page.biddercode }}" href="bidders/{{ page.biddercode }}.html" target="_blank">{{ page.title }}</a></h1>
<h1><a name="{{ page.biddercode }}" />{{ page.title }}</h1>

<h3>bidder code:</h3>

Expand Down
Loading

0 comments on commit 099edc2

Please sign in to comment.