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

additional universal creative updates #1018

Merged
merged 3 commits into from
Nov 14, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
49 changes: 35 additions & 14 deletions adops/send-all-bids-adops.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ See the [Publisher API Reference]({{site.baseurl}}/dev-docs/publisher-api-refere

+ From the ad ops side, you may choose to set up one order per bidder, so that each order can have a set of line items using targeting keywords that include the bidder's name. For example, if you are working with [Rubicon]({{site.baseurl}}/dev-docs/bidders.html#rubicon), you would use `hb_pb_rubicon` in your line item's key-value targeting, and `hb_adid_rubicon` in the creative.

{% include send-all-bids-keyword-targeting.md %}
{% include send-all-bids-keyword-targeting.md %}

{: .bg-info :}
In this example we will use DFP setup to illustrate, but the steps are basically the same for any ad server.
Expand Down Expand Up @@ -90,27 +90,48 @@ Next, add a creative to this $0.50 line item; we will duplicate the creative lat

Choose the same advertiser we've assigned the line item to.

Note that this has to be a **Third party** creative. The **"Serve in Safeframe"** box has to be **UNCHECKED** (there are plans to make the below creative safeframe compatible).
Note that this has to be a **Third party** creative. The **"Serve into a Safeframe"** box can be **UNCHECKED** or **CHECKED** (Prebid Universal Creatve is SafeFrame compatible).

Copy this creative code snippet and paste it into the **Code snippet** box.

Edit the `hb_adid_BIDDERCODE` to replace `BIDDERCODE` with the name of the bidder that will serve into this creative, e.g., `hb_adid_rubicon`.
<script src = "https://cdn.jsdelivr.net/npm/prebid-universal-creative@latest/dist/creative.js"></script>
<script>
var ucTagData = {};
ucTagData.adServerDomain = "";
ucTagData.pubUrl = "%%PATTERN:url%%";
ucTagData.targetingMap = %%PATTERN:TARGETINGMAP%%;

try {
ucTag.renderAd(document, ucTagData);
} catch (e) {
console.log(e);
}
</script>

Note: If you're working an ad server other than DFP, your code snippet will look like this:

<script src="https://cdn.jsdelivr.net/npm/prebid-universal-creative@latest/dist/creative.js"></script>
<script>
var w = window;
for (i = 0; i < 10; i++) {
w = w.parent;
if (w.pbjs) {
try {
w.pbjs.renderAd(document, '%%PATTERN:hb_adid_BIDDERCODE%%');
break;
} catch (e) {
continue;
}
var ucTagData = {};
ucTagData.adServerDomain = "";
ucTagData.pubUrl = "%%KEYWORD:url%%";
ucTagData.adId = "%%KEYWORD:hb_adid%%";
ucTagData.cacheHost = "%%KEYWORD:hb_cache_host%%";
ucTagData.cachePath = "%%KEYWORD:hb_cache_path%%";
ucTagData.uuid = "%%KEYWORD:hb_cache_id%%";
ucTagData.mediaType = "%%KEYWORD:hb_format%%";
ucTagData.env = "%%KEYWORD:hb_env%%";
ucTagData.size = "%%KEYWORD:hb_size%%";

try {
ucTag.renderAd(document, ucTagData);
} catch (e) {
console.log(e);
}
}
</script>

The `KEYWORD` macro is for use with Mopub. For all other ad servers, replace `KEYWORD` with the appropriate macro for the ad server. (Refer to your ad server's documentation or consult with a representative for specific details regarding the proper macros and how to use them.)

{: .pb-img.pb-lg-img :}
![New creative]({{ site.github.url }}/assets/images/demo-setup/new-creative.png)

Expand Down
65 changes: 33 additions & 32 deletions adops/setting-up-prebid-with-the-appnexus-ad-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,31 @@ nav_section: tutorials
---

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

# Setting up Prebid with the AppNexus Publisher Ad Server
{: .no_toc}

This page describes how to set up the AppNexus Publisher Ad Server to work with Prebid.js from an Ad Ops perspective.

In some cases there are links to the [AppNexus wiki](https://wiki.appnexus.com) which may require a customer login.
In some cases there are links to the [AppNexus Console Help Center](https://console.appnexus.com/docs/home) which require a customer login.

Once the Ad Ops setup is complete, developers will need to add code to the page as shown in the example [Using Prebid.js with AppNexus as your Ad Server]({{site.github.url}}/dev-docs/examples/use-prebid-with-appnexus-ad-server.html).

{: .alert.alert-success :}
**AppNexus Publisher Ad Server Features**
Note that the functionality described on this page uses some features that are only available in the AppNexus Publisher Ad Server product, such as [key-value targeting](https://wiki.appnexus.com/x/-PQdBQ). For more information, contact your AppNexus representative.
Note that the functionality described on this page uses some features that are only available in the AppNexus Publisher Ad Server product, such as [key-value targeting](https://console.appnexus.com/docs/key-value-targeting). For more information, contact your AppNexus representative.

{: .alert.alert-info :}
**Object Limits**
Note that using Prebid with AppNexus as your ad server may cause you to
hit your AppNexus [Object Limits](https://wiki.appnexus.com/x/CwIWAg).
hit your AppNexus [Object Limits](https://console.appnexus.com/docs/viewing-your-object-limits).

* TOC
{:toc}

## Step 1. Add Key-Values

In the [key-value targeting](https://wiki.appnexus.com/x/-PQdBQ) in Console, set up the keys and values shown below. Keep in mind that all of the keys described below should use string values (**not** numeric).
In the [key-value targeting](https://console.appnexus.com/docs/key-value-targeting) in Console, set up the keys and values shown below. Keep in mind that all of the keys described below should use string values (**not** numeric).

If you are only sending the winning bid to the ad server, set up your keys like so:

Expand All @@ -51,7 +51,7 @@ Otherwise, if you are [sending all bids to the ad server]({{site.github.url}}/de
|------------------+----------------|
| `hb_pb_rubicon` | `0.1` |

Depending on the price granularity you want, you may find one of the following CSV files helpful. Each file has the buckets for that granularity level predefined. You can avoid manually setting up key-value targeting by uploading the appropriate CSV file on the [key-values screen](https://wiki.appnexus.com/x/-PQdBQ):
Depending on the price granularity you want, you may find one of the following CSV files helpful. Each file has the buckets for that granularity level predefined. You can avoid manually setting up key-value targeting by uploading the appropriate CSV file on the [key-values screen](https://console.appnexus.com/docs/key-value-targeting):

+ [10cent-prebid-buckets.csv]({{site.github.url}}/assets/csv/10cent-prebid-buckets.csv)
+ [25cent-prebid-buckets.csv]({{site.github.url}}/assets/csv/25cent-prebid-buckets.csv)
Expand All @@ -60,41 +60,42 @@ Depending on the price granularity you want, you may find one of the following C
For more information about how to set up price bucket granularity in Prebid.js code, see the API documentation for [`pbjs.setPriceGranularity`]({{site.github.url}}/dev-docs/publisher-api-reference.html#module_pbjs.setPriceGranularity).

{: .alert.alert-success :}
You can only report on price bucket values if you provide them in the <a href="https://wiki.appnexus.com/x/-PQdBQ">Key-Value Targeting UI</a>.
You can only report on price bucket values if you provide them in the <a href="https://console.appnexus.com/docs/key-value-targeting">Key-Value Targeting UI</a>.

## Step 2. Add Creatives

You'll need one creative per ad size you'd like to serve. You can re-use a creative across any number of line items and campaigns.

Follow the creative setup instructions in [Add Creatives](https://wiki.appnexus.com/x/GoGzAQ) with the settings described below.

- The creative **Type** should be **Third-party creative**.
Follow the creative setup instructions in [Add Creatives](https://console.appnexus.com/docs/add-creatives) with the following setting:

- The **Creative format** should be **Third-party tag**.
- Select **Show Template Selector**.

- The **Tag type** is HTML.
- Select a template with an HTML format.

- Make sure the **Serve in iFrame** box is not checked.
- Paste the code snippet shown below into the code box.

- The creative content should be the HTML and JavaScript shown below.

{: .alert.alert-success :}
If you are using "send all bids" mode, the macro in the call to `renderAd` below should match the header bidding partner associated with that creative, e.g., `'#{HB_ADID_RUBICON}'`, `'#{HB_ADID_PARTNER}'`, etc.
{: .pb-img.pb-lg-img :}
![New creative]({{ site.github.url }}/assets/images/ad-ops/appnexus-setup/prebid-creative-appnexus.png)

{% highlight html %}
<script src = "https://cdn.jsdelivr.net/npm/prebid-universal-creative@latest/dist/creative.js"></script>
<script>
var w = window;
for (i = 0; i < 10; i++) {
w = w.parent;
if (w.pbjs) {
try {
w.pbjs.renderAd(document, '#{HB_ADID}');
break;
} catch (e) {
continue;
}
}
}
var ucTagData = {};
ucTagData.adServerDomain = window.location.host;
ucTagData.pubUrl = "${REFERER_URL_ENC}";
ucTagData.adId = "#{HB_ADID}";
ucTagData.cacheHost = "";
ucTagData.cachePath = "";
ucTagData.uuid = "";
ucTagData.mediaType = "#{HB_FORMAT}";
ucTagData.env = "";
ucTagData.size = "#{HB_SIZE}";

try {
ucTag.renderAd(document, ucTagData);
} catch (e) {
console.log(e);
}
</script>
{% endhighlight %}

Expand All @@ -108,7 +109,7 @@ You'll need to create one line item for every price bucket you intend to serve.

For example, if you want to have $0.10 price granularity, you'll need 201 line items, one for each of your key-value targeting settings from Step 1.

For each line item, follow the line item setup instructions in [Create a Line Item](https://wiki.appnexus.com/x/MYCzAQ), with the following settings:
For each line item, follow the line item setup instructions in [Create a Line Item](https://console.appnexus.com/docs/create-a-standard-line-item), with the following settings:

- Set the **Revenue Type** to *CPM*.

Expand All @@ -122,15 +123,15 @@ For each line item, follow the line item setup instructions in [Create a Line It

- Still in the targeting settings, target the custom category `prebid_enabled`. This will allow you to turn targeting on and off for a placement (or an entire placement group) by adding it to the custom category, which you'll do in one of the later steps. This is useful for troubleshooting.

For more information about targeting custom content categories, see [Content Category Targeting](https://wiki.appnexus.com/x/XAEcB).
For more information about targeting custom content categories, see [Content Category Targeting](https://console.appnexus.com/docs/content-category-targeting).

## Step 4. Set up Campaigns

For each line item, create one campaign to associate with it. The campaign should have an unlimited budget, start running right away, and run indefinitely.

You shouldn't have to do anything else. All other settings (such as budget and targeting) are inherited from the line item.

For more information, see the full campaign setup instructions at [Create a Campaign](https://wiki.appnexus.com/x/04KUAg).
For more information, see the full campaign setup instructions at [Create a Campaign](https://console.appnexus.com/docs/create-a-campaign).

## Step 5. Add the `prebid_enabled` Custom Category to Placements

Expand Down
25 changes: 12 additions & 13 deletions adops/step-by-step.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,23 +72,22 @@ Next, add a creative to this $0.50 line item; we will duplicate the creative lat

Choose the same advertiser we've assigned the line item to.

Note that this has to be a **Third party** creative. The **"Serve in Safeframe"** box has to be **UNCHECKED** (there are plans to make the below creative safeframe compatible).
Note that this has to be a **Third party** creative. The **"Serve into a Safeframe"** box can be **UNCHECKED** or **CHECKED** (Prebid Universal Creatve is SafeFrame compatible).

Copy this creative code snippet and paste it into the **Code snippet** box.

<script src = "https://cdn.jsdelivr.net/npm/prebid-universal-creative@latest/dist/creative.js"></script>
<script>
var w = window;
for (i = 0; i < 10; i++) {
w = w.parent;
if (w.pbjs) {
try {
w.pbjs.renderAd(document, '%%PATTERN:hb_adid%%');
break;
} catch (e) {
continue;
}
var ucTagData = {};
ucTagData.adServerDomain = "";
ucTagData.pubUrl = "%%PATTERN:url%%";
ucTagData.targetingMap = %%PATTERN:TARGETINGMAP%%;

try {
ucTag.renderAd(document, ucTagData);
} catch (e) {
console.log(e);
}
}
</script>

{: .pb-img.pb-lg-img :}
Expand All @@ -100,7 +99,7 @@ Make sure the creative size is set to 1x1. This allows us to set up size overri

Next, let's attach the creative to the $0.50 line item you just created. Click into the Line Item, then the **Creatives** tab.

There will be yellow box showing each ad spot that you haven't uploaded creatives for yet. Since you've already made the creatives, click the **use existing creatives** next to each size.
There will be yellow box showing each ad spot that you haven't uploaded creatives for yet. Since you've already made the creatives, click **use existing creatives** next to each size.

![Use existing creatives list]({{ site.github.url }}/assets/images/demo-setup/use-existing-creatives-01.png)

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion dev-docs/show-prebid-ads-on-amp-pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ For Mopub:

{% endhighlight %}

For all other ad servers, replace `KEYWORD` in the preceding example with the appropriate macro for the ad server.
For all other ad servers, replace `KEYWORD` in the preceding example with the appropriate macro for the ad server. (Refer to your ad server's documentation or consult with a representative for specific details regarding the proper macros and how to use them.)

### User Sync

Expand Down