Skip to content
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

Add multiformat docs: developers, ad ops, example code #561

Merged
merged 51 commits into from
Jan 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
e3eb5bf
WIP multiformat docs
Jan 18, 2018
214f59f
Flesh out prerequisites/implementation of dev doc
Jan 19, 2018
0033fcb
Add multi-format docs to 'Docs by Format'
Jan 19, 2018
42644fa
Add a quick example of *why* to do this
Jan 19, 2018
e1c7548
Outline steps on ad ops page
Jan 19, 2018
aeeac8b
Clarify multi-format on 'Docs by format' page
Jan 19, 2018
8ca48b8
Various dev doc fixups
Jan 19, 2018
7813214
Update JSFiddle, overview bullet points in example
Jan 19, 2018
bf266aa
Update multiformat fiddle
Jan 23, 2018
a76d3ae
Key is now called `hb_format`
Jan 23, 2018
32d5d68
s/multi-format/multiformat/
Jan 23, 2018
c580344
Use 'appnexus' bidder and Prebid.js v1
Jan 23, 2018
79bad3b
s/multi-format/multiformat/
Jan 23, 2018
cff4142
Be clear that it's *outstream* video
Jan 23, 2018
002baba
Use title case
Jan 23, 2018
538f782
Update multiformat example link
Jan 23, 2018
f29de26
Fill in multiformat ad ops instructions
Jan 23, 2018
c54bec3
Add native aspect ratio info to AN adapter docs (#543)
rmloveland Jan 24, 2018
704cdf4
Add multiformat ad unit information (#541)
matthewlane Jan 24, 2018
0e6d711
update tag samples with multiformat syntax (#528)
jsnellbaker Jan 24, 2018
8a67f2e
s/multiformat/multi-format/g
Jan 25, 2018
8a05c90
We don't need an order per demand partner
Jan 25, 2018
fe2edcb
Remove ambiguous comment on fluid vs. fixed native
Jan 25, 2018
08d65cc
Update multi-format language in dev setup intro
Jan 25, 2018
be9fd69
Update multi-format description based on feedback
Jan 25, 2018
83efd5a
Update 'How it works' based on feedback
Jan 25, 2018
2ce71da
Update ad unit language based on feedback
Jan 25, 2018
639aae0
Fix Prebid.org-hosted multiformat example
Jan 25, 2018
e78286a
Update JSFiddle in multiformat example
Jan 25, 2018
96357cb
Add ad unit creation step with sizing/native info
Jan 25, 2018
c857214
Clarify line item setup language
Jan 25, 2018
418cab5
Update k-v targeting instructions per feedback
Jan 26, 2018
595002a
Check in screenshots of multi-format ad ops setup
Jan 26, 2018
3c42b81
Update native format language per feedback
Jan 26, 2018
6c1a446
Clarify that it's banner and/or outstream
Jan 26, 2018
7649b51
Note bidder-specific line item targeting keys
Jan 26, 2018
ab96040
Update targeting description per feedback
Jan 26, 2018
17c9013
Update native size note, per feedback
Jan 26, 2018
f79abbe
Fix mobile size per feedback
Jan 26, 2018
d2df4d0
Hide multi-format example from site's left nav
Jan 26, 2018
83e1042
Belatedly add link to the 1.0 release announcement
Jan 26, 2018
ad53c49
Fix typo
Jan 26, 2018
5001f63
Use Prebid.org-hosted multi-format example
Jan 26, 2018
00c7223
Merge branch 'master' into multiformat-docs
rmloveland Jan 26, 2018
b188f67
s/div-banner-outstream/div-banner-native/g
Jan 26, 2018
1556a3e
Add a third example: 'banner-outstream'
Jan 26, 2018
f5e56b3
Update examples to set `cache.url` to `false`
Jan 29, 2018
2c4d531
Update placement IDs in Prebid.org-hosted example
Jan 29, 2018
ba8a77f
Update JSFiddle to use updated placement IDs
Jan 29, 2018
0e604fa
Get banner/outstream examples working: use 300x250
Jan 29, 2018
182b37b
Fix broken formatting on JSFiddle example page
Jan 29, 2018
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
3 changes: 3 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ nav_sections:
- top_nav: dev_docs
code: quick-start
name: DEVELOPER QUICK START
- top_nav: dev_docs
code: prebid-multi-format
name: PREBID MULTI-FORMAT (ALPHA)
- top_nav: dev_docs
code: prebid-video
name: PREBID VIDEO (BETA)
Expand Down
85 changes: 85 additions & 0 deletions adops/setting-up-prebid-multi-format-in-dfp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
layout: page
title: Setting up Prebid Multi-Format in DFP
head_title: Setting up Prebid Multi-Format in DFP
description: Setting up Prebid Multi-Format in DFP
pid: 3
hide: false
top_nav_section: adops
nav_section: tutorials
---

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

# Setting up Prebid Multi-Format in DFP
{: .no_toc}

This page shows how to set up your ad server so that you can serve multi-format ads.

Multi-Format ads allow you to declare multiple media types on a single ad unit. For example, you can set up one ad on the page that could show a banner, native, or outstream video ad, depending on which had the highest bid.

{: .alert.alert-info :}
For instructions on how to set up multi-format ads from the engineering side, see [Show Multi-Format Ads with Prebid.js]({{site.baseurl}}/dev-docs/show-multi-format-ads.html).

* TOC
{: toc }

## Step 1. Add an Ad Unit

In DFP, [create an ad unit](https://support.google.com/dfp_premium/answer/177203?hl=en).

Decide what combination of formats will be permitted on the ad unit. This will determine what sizes you allow to serve. The ad unit's sizes must be configured properly to support the combination of formats that will be permitted.

If your ad unit will support native ads, you may want to create a custom **Prebid Native Format** and at least one **Prebid Native Style**. Examples of each are given in [Setting up Prebid Native in DFP][nativeAdSetup].

## Step 2. Add an Order

In DFP, create a new order. This order will be associated with the multiple line items needed to run multi-format auctions.

## Step 3. Add Line Items and Creatives for each Media Type

Multi-format ad units which support native require at least two distinct sets of line items and creatives:

+ One for [banners and/or outstream video][bannerAdSetup]. Banners and outstream videos will serve into a DFP banner creative.

+ One for [native][nativeAdSetup]. Native ads will serve into a native creative with native format and styles.

### Banner/Outstream

Follow the instructions for creating line items and creatives in [Send all bids to the ad server][bannerAdSetup], with the following changes:

+ Add key-value targeting for **'hb_format' is ('banner' OR 'video')**
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we note that hb_format_[BIDDER_CODE] would need to be specified for bidder-specific line items?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes! Added the following note in 7649b51:

For bidder-specific line items, specify hb_format_{BIDDER_CODE}, e.g., hb_format_appnexus

+ This will ensure that the appropriate ad server line item is activated for banner / outstream bids
+ For bidder-specific line items, specify `hb_format_{BIDDER_CODE}`, e.g., `hb_format_appnexus`

![Set hb_format to 'banner,video']({{site.baseurl}}/assets/images/ad-ops/multi-format/hb_format_video_banner.png)

+ Make sure that you're targeting the right sizes for both banner ads and any outstream ads you want to serve in this slot, e.g.,
+ 1x1 for outstream (or whatever size you pass into DFP as your outstream impression)
+ whatever banner sizes are valid for your site / use case

### Native

Follow the instructions for creating line items, creatives, custom native formats, and native styles in [Show Native Ads][nativeAdSetup], with the following changes:

+ Add key-value targeting for **'hb_format' is 'native'**

![Set 'hb_format' to 'native']({{site.baseurl}}/assets/images/ad-ops/multi-format/hb_format_native.png)

+ Make sure you're targeting the right sizes for the native ads you want to serve:
+ Fixed-size native, where you specify one or more absolute sizes
+ Fluid, which expands to fit whatever space it's put in
+ For more information on fluid vs. fixed, see [the DFP docs](https://support.google.com/dfp_premium/answer/6366914?hl=en)

## Related Topics

+ [Show Multi-Format Ads with Prebid.js]({{site.baseurl}}/dev-docs/show-multi-format-ads.html) (Engineering setup)
+ [Multi-Format Example]({{site.baseurl}}/dev-docs/examples/multi-format-example.html) (Example code)

</div>

<!-- Reference Links -->

[bannerAdSetup]: {{site.baseurl}}/adops/send-all-bids-adops.html
[nativeAdSetup]: {{site.baseurl}}/adops/setting-up-prebid-native-in-dfp.html
[createCustomNativeFormat]: {{site.baseurl}}/adops/setting-up-prebid-native-in-dfp.html#create-a-custom-native-ad-format
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions dev-docs/bidder-adaptor.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Module that connects to Example's demand sources
code: 'test-div',
mediaTypes: {
banner: {
sizes: [[300, 50]], // a mobile size
sizes: [[320, 50]], // a mobile size
}
},
bids: [
Expand Down Expand Up @@ -223,9 +223,9 @@ Sample array entry for `validBidRequests[]`:
{% endhighlight %}

{: .alert.alert-success :}
There are several IDs present in the bidRequest object:
- **Bid ID** is unique across ad units and bidders.
- **Auction ID** is unique per call to `requestBids()`, but is the same across ad units.
There are several IDs present in the bidRequest object:
- **Bid ID** is unique across ad units and bidders.
- **Auction ID** is unique per call to `requestBids()`, but is the same across ad units.
- **Transaction ID** is unique for each ad unit with a call to `requestBids`, but same across bidders. This is the ID that DSPs need to recognize the same impression coming in from different supply sources.

The ServerRequest objects returned from your adapter have this structure:
Expand Down
28 changes: 15 additions & 13 deletions dev-docs/docs-by-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,20 @@ For ad ops and other ad server-related information, see [our Ad Ops documentatio
{:toc}

{: .table .table-bordered .table-striped }
| Format | Page |
|---------------------+----------------------------------------------------------------------------------------------------------------------------------|
| *AMP* | [How Prebid on AMP Works]({{site.github.url}}/dev-docs/how-prebid-on-amp-works.html) |
| | [Show Prebid Ads on AMP Pages (Alpha)]({{site.github.url}}/dev-docs/show-prebid-ads-on-amp-pages.html) |
| *Video* (instream) | [Show Video Ads with a DFP Video Tag]({{site.github.url}}/dev-docs/show-video-with-a-dfp-video-tag.html) (With lots of examples) |
| | [How to Add a New Video Bidder Adapter]({{site.github.url}}/dev-docs/how-to-add-a-new-video-bidder-adaptor.html) |
| *Video* (outstream) | [Show Outstream Video Ads]({{site.github.url}}/dev-docs/show-outstream-video-ads.html) |
| | [Outstream Video Example]({{site.github.url}}/dev-docs/examples/outstream-video-example.html) |
| *Standard Display* | [Basic Prebid.js Example]({{site.github.url}}/dev-docs/examples/basic-example.html) |
| | [Getting Started]({{site.github.url}}/dev-docs/getting-started.html) |
| | [Ad Unit Refresh / Infinite Scroll Example]({{site.github.url}}/dev-docs/examples/adunit-refresh.html) |
| *Native* | [Show Native Ads with Prebid.js]({{site.github.url}}/dev-docs/show-native-ads.html) (Engineering setup) |
| | [Setting up Prebid Native in DFP]({{site.github.url}}/adops/setting-up-prebid-native-in-dfp.html) (Ad Ops setup) |
| Format | Page |
|---------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------|
| *Multi-Format (banner, native, outstream video all in one ad unit)* | [Show Multi-Format Ads with Prebid.js]({{site.baseurl}}/dev-docs/show-multi-format-ads.html) (Engineering setup) |
| | [Setting up Prebid Multi-Format in DFP]({{site.baseurl}}/adops/setting-up-prebid-multi-format-in-dfp.html) (Ad ops setup) |
| *AMP* | [How Prebid on AMP Works]({{site.github.url}}/dev-docs/how-prebid-on-amp-works.html) |
| | [Show Prebid Ads on AMP Pages (Alpha)]({{site.github.url}}/dev-docs/show-prebid-ads-on-amp-pages.html) |
| *Video* (instream) | [Show Video Ads with a DFP Video Tag]({{site.github.url}}/dev-docs/show-video-with-a-dfp-video-tag.html) (With lots of examples) |
| | [How to Add a New Video Bidder Adapter]({{site.github.url}}/dev-docs/how-to-add-a-new-video-bidder-adaptor.html) |
| *Video* (outstream) | [Show Outstream Video Ads]({{site.github.url}}/dev-docs/show-outstream-video-ads.html) |
| | [Outstream Video Example]({{site.github.url}}/dev-docs/examples/outstream-video-example.html) |
| *Standard Display* | [Basic Prebid.js Example]({{site.github.url}}/dev-docs/examples/basic-example.html) |
| | [Getting Started]({{site.github.url}}/dev-docs/getting-started.html) |
| | [Ad Unit Refresh / Infinite Scroll Example]({{site.github.url}}/dev-docs/examples/adunit-refresh.html) |
| *Native* | [Show Native Ads with Prebid.js]({{site.github.url}}/dev-docs/show-native-ads.html) (Engineering setup) |
| | [Setting up Prebid Native in DFP]({{site.github.url}}/adops/setting-up-prebid-native-in-dfp.html) (Ad Ops setup) |

</div>
20 changes: 20 additions & 0 deletions dev-docs/examples/multi-format-example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
Copy link
Contributor

Choose a reason for hiding this comment

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

I am seeing "Prebid.js Multi-Format Example" appear in the left nav under "Developer Quick Start" on all /dev-docs/ pages. Is this intended?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope! Forgot to add a hide key in the YAML header. Addressed in d2df4d0

layout: example
title: Prebid.js Multi-Format Example
description: Prebid.js Multi-Format Example
top_nav_section: dev_docs
nav_section: quick-start
hide: true
about:
- Multi-Format ads allow you to declare multiple media types on a single ad unit
- Set up one ad unit that could show a banner, native, or outstream video ad
- Any bidder that supports at least one of the listed media types can participate in the auction for that ad unit
- For engineering setup instructions, see <a href="/dev-docs/show-multi-format-ads.html">Show Multi-Format Ads</a>
- For ad ops setup instructions, see <a href="/adops/setting-up-prebid-multi-format-in-dfp.html">Setting up Prebid Multi-Format in DFP</a>
- <em>Note</em> - Outstream ads only work sporadically in the embedded JSFiddle below; try the Prebid.org-hosted <a href="/examples/multi_format_example.html">Multi-Format Example</a>
jsfiddle_link: jsfiddle.net/prebid/mg81j0rw/12/embedded/html,result
code_lines: 110
code_height: 2389
use_old_example_style: false
pid: 11
---
19 changes: 10 additions & 9 deletions dev-docs/publisher-api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pid: 10
This page has documentation for the public API methods of Prebid.js.

{: .alert.alert-danger :}
Methods marked as deprecated will be removed in version 1.0 (scheduled for release Q4 2017).
Methods marked as deprecated were removed in version 1.0. For more information about the changes, see [the release announcement]({{site.baseurl}}/blog/prebid-1-is-released).
After a transition period, documentation for these methods will be removed from Prebid.org (likely early 2018).

<a name="module_pbjs"></a>
Expand Down Expand Up @@ -605,7 +605,8 @@ See the table below for the list of properties in the `mediaTypes` object of the
+ [Native](#adUnit-native)
+ [Video](#adUnit-video)
+ [Banner](#adUnit-banner)
+ [Multi-format](#adUnit-multiformat)
+ [Multi-format](#adUnit-multi-format)


<a name="adUnit-native">

Expand Down Expand Up @@ -727,7 +728,7 @@ pbjs.addAdUnits({
})
```

<a name="adUnit-multiformat">
<a name="adUnit-multi-format">

##### Multi-format

Expand Down Expand Up @@ -1119,7 +1120,7 @@ For an example showing how to use this method, see [Show Video Ads with a DFP Vi
This method is deprecated as of version 0.27.0 and will be removed in version 1.0 (scheduled for release Q4 2017). Please use [`setConfig`](#module_pbjs.setConfig) instead.

{: .alert.alert-danger :}
**BREAKING CHANGE**
**BREAKING CHANGE**
As of version 0.27.0, To encourage fairer auctions, Prebid will randomize the order bidders are called by default. To replicate legacy behavior, call `pbjs.setBidderSequence('fixed')`.

This method shuffles the order in which bidders are called.
Expand Down Expand Up @@ -1307,9 +1308,9 @@ pbjs.setConfig({ bidderTimeout: 3000 });
{% endhighlight %}

{: .alert.alert-warning :}
**Bid Timeouts and JavaScript Timers**
Note that it's possible for the timeout to be triggered later than expected, leading to a bid participating in the auction later than expected. This is due to how [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setTimeout) works in JS: it queues the callback in the event loop in an approximate location that *should* execute after this time but *it is not guaranteed*.
With a busy page load, bids can be included in the auction even if the time to respond is greater than the timeout set by Prebid.js. However, we do close the auction immediately if the threshold is greater than 200ms, so you should see a drop off after that period.
**Bid Timeouts and JavaScript Timers**
Note that it's possible for the timeout to be triggered later than expected, leading to a bid participating in the auction later than expected. This is due to how [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setTimeout) works in JS: it queues the callback in the event loop in an approximate location that *should* execute after this time but *it is not guaranteed*.
With a busy page load, bids can be included in the auction even if the time to respond is greater than the timeout set by Prebid.js. However, we do close the auction immediately if the threshold is greater than 200ms, so you should see a drop off after that period.
For more information about the asynchronous event loop and `setTimeout`, see [How JavaScript Timers Work](https://johnresig.com/blog/how-javascript-timers-work/).

<a name="setConfig-Send-All-Bids" />
Expand Down Expand Up @@ -1435,7 +1436,7 @@ However, there are also good reasons why publishers may want to control the use
- *Security*: Publishers may want to control which bidders are trusted to inject images and JavaScript into their pages.

{: .alert.alert-info :}
**User syncing default behavior**
**User syncing default behavior**
If you don't tweak any of the settings described in this section, the default behavior of Prebid.js is to wait 3 seconds after the auction ends, and then allow every adapter to drop up to 5 image-based user syncs.

For more information, see the sections below.
Expand Down Expand Up @@ -1818,7 +1819,7 @@ var adserverTag = 'https://pubads.g.doubleclick.net/gampad/ads?'
+ 'sz=640x480&iu=/19968336/prebid_cache_video_adunit&impl=s&gdfp_req=1'
+ '&env=vp&output=xml_vast2&unviewed_position_start=1&hl=en&url=http://www.example.com'
+ '&cust_params=section%3Dblog%26anotherKey%3DanotherValue';

var videoUrl = pbjs.adServers.dfp.buildVideoUrl({
adUnit: videoAdUnit,
url: adserverTag
Expand Down
Loading