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 example of bid filtering on meta object #3123

Merged
merged 8 commits into from
Aug 31, 2021
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
9 changes: 9 additions & 0 deletions _data/sidebar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,15 @@
isSectionHeader: 0
sectionTitle:
subgroup: 1

- sbSecId: 1
title: Meta Bid Filtering
link: /dev-docs/examples/meta-bid-filtering.html
Item: 1
isHeader: 0
isSectionHeader: 0
sectionTitle:
subgroup: 1

- sbSecId: 1
title: Troubleshooting
Expand Down
18 changes: 9 additions & 9 deletions _layouts/example.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,11 @@ <h4>This page contains:</h4>
</ul>
</p>

<p>
On the JSFiddle example below, click <strong>Result</strong> to see the result.
</p>

<p>
Click <strong>Edit in JSFiddle</strong> to open the example in a new tab.
</p>

<p>
For tips and troubleshooting info, see:
<ul>
<li>
<a href="{{site.github.url}}/dev-docs/troubleshooting-tips.html">Tips for Troubleshooting</a>
<a href="/troubleshooting/troubleshooting-guide.html">Troubleshooting Guide</a>
</li>
<li>
<a href="{{site.github.url}}/dev-docs/common-issues.html">Common Issues</a>
Expand All @@ -71,6 +63,14 @@ <h4>This page contains:</h4>
</div>
</div>

<p></p>
<p>
On the JSFiddle example below:
<ul><li>click 'Result' to see the output of the page.</li>
<li>Click 'Edit in JSFiddle' to open the example in a new tab.</li></ul>
</p>


<div class="row">
<!-- JSFiddle -->
<div id="jsfiddle" class="col-md-12">
Expand Down
1 change: 0 additions & 1 deletion debugging/debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,3 @@ benefit from implementation improvements.
Further Reading

+ [Prebid.js Troubleshooting Guide]({{site.github.url}}/dev-docs/prebid-troubleshooting-guide.html)
+ [Prebid.js Troubleshooting Tips]({{site.github.url}}/dev-docs/troubleshooting-tips.html)
2 changes: 1 addition & 1 deletion dev-docs/common-issues.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ Check the bid prices. If they are low and are getting reduced to $0 due to price
{:toc}

+ [Prebid.js FAQ](/dev-docs/faq.html)
+ [Prebid Tips for Troubleshooting]({{site.github.url}}/dev-docs/troubleshooting-tips.html)
+ [Prebid Tips for Troubleshooting](/troubleshooting/troubleshooting-guide.html)


18 changes: 18 additions & 0 deletions dev-docs/examples/meta-bid-filtering
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
layout: example
title: Meta Bid Filtering
description: Bid filtering on meta object example
sidebarType: 1


about:
- Filter particular values or if meta object is provided
- Integration with single Google Ad Manager ad slot
- Default price granularity

jsfiddle_link:
https://jsfiddle.net/Prebid_Examples/0s4eug1d/18/embedded/html,result

code_height:
2300
---
15 changes: 15 additions & 0 deletions dev-docs/examples/meta-bid-filtering.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
layout: example
title: Meta Bid Filtering
left_nav_override: Examples
description: Bid filtering on meta object example
sidebarType: 1

about:
- Bidders can supply metadata about the bid such as advertiser domain. See the "meta" fields in the <a href="/dev-docs/bidder-adaptor.html#interpreting-the-response">bid response</a> for the full list.
- This is an example that filters bid responses based on the metadata object.

jsfiddle_link: jsfiddle.net/Prebid_Examples/0s4eug1d/18/embedded/html,result

code_height: 2300
---
10 changes: 7 additions & 3 deletions dev-docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@ It's technically possible, but we don't recommend doing this:

If all this wasn't enough to warn you away from trying, it should work if you name the PBJS global differently for each instance (https://github.com/prebid/Prebid.js/blob/master/package.json#L20)

## Can I filter bid responses that don't meet my criteria?

Yes. Many bidders provide metadata about the bid that can be used in troubleshooting
and filtering. See the [list of bid response metadata](/dev-docs/bidder-adaptor.html#interpreting-the-response) and the [filtering example](/dev-docs/examples/meta-bid-filtering.html).

## Does Prebid.js resolve the AUCTION_PRICE macro?

Yes, but in a way that could cause discrepancies in reporting. It's recommended
Expand All @@ -168,9 +173,8 @@ that [bid adapters resolve OpenRTB macros](/dev-docs/bidder-adaptor.html#resolve
For historic reasons, Prebid will resolve the AUCTION_PRICE macro, but it will be after currency conversion and any bid adjustments.
This differs from how OpenRTB defines this value as being the clearing price in the bid currency. Header Bidding is a first-price auction, the best candidate for “clearing price” is the original bid itself.


## Related Reading

+ [Prebid.js Dev Tips]({{site.baseurl}}/dev-docs/troubleshooting-tips.html)
+ [Prebid.js Common Issues]({{site.baseurl}}/dev-docs/common-issues.html)
+ [Prebid.js Troubleshooting Guide](/troubleshooting/troubleshooting-guide.html)
+ [Prebid.js Common Issues](/dev-docs/common-issues.html)
+ [Prebid.js issues tagged 'question'](https://github.com/prebid/Prebid.js/issues?utf8=%E2%9C%93&q=is%3Aissue%20label%3Aquestion%20)
111 changes: 1 addition & 110 deletions dev-docs/prebid-troubleshooting-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
layout: page_v2
title: Prebid.js Troubleshooting Guide
head_title: Prebid.js Troubleshooting Guide
description: How to troubleshoot Prebid.js from the perspective of an ad call from start to finish.
pid: 10
top_nav_section: dev_docs
nav_section: troubleshooting
sidebarType: 1
---

Expand All @@ -14,109 +10,4 @@ sidebarType: 1
# Prebid.js Troubleshooting Guide
{:.no_toc}

{: .alert.alert-danger :}
Prebid.org does not support any version of Prebid.js prior to version 1.0.

Use this guide to troubleshoot your Prebid.js integration. You can follow this guide sequentially to determine whether Prebid.js is working as intended on your website. It takes you through the ad call from start to finish.

* TOC
{:toc}

## Check Your Prebid Version

The open source code in Prebid.js can change frequently. To see what version of Prebid.js you are using, open your browser console and type `pbjs.version;`.

You can reference this against the changes listed in the [Prebid.js Release Notes](https://github.com/prebid/Prebid.js/releases).

## Delay the Ad Server Call so Key-Values can be Set

Make sure that you delay any calls to the ad server. This allows all of the key-values to be set before the auction in the ad server occurs.

Within Google Ad Manager, this is achieved by adding the following code to your page. It should be called before any of the ad server code to make sure it runs first.

{% highlight js %}
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
googletag.cmd.push(function() {
googletag.pubads().disableInitialLoad();
});
{% endhighlight %}

## Check the Ad Units on the Page

Make sure the ad units configured for Prebid.js match up with the ad units that have been set up in your ad server.

You can review what ad units have been configured for Prebid by opening your browser console and typing `pbjs.getBidResponses();`. This will show a list of what div IDs are present:

![pbjs.getBidResponses() showing ad units in browser console]({{site.github.url}}/assets/images/overview/prebid-troubleshooting-guide/ad-units.png "pbjs.getBidResponses() showing ad units in browser console"){: .pb-lg-img :}

## List your Bids and Bidders

Open your browser console and type `pbjs.getBidResponses();` to see a list of the ad units that have been configured. This also shows what bids have been returned from each of the bidder partners in chronological order as shown in the screenshot below.

To see all of the winning bids, open your browser console and type [`pbjs.getAllWinningBids();`]({{site.baseurl}}/dev-docs/publisher-api-reference/getAllWinningBids.html).

{: .alert.alert-danger :}
Keep in mind that any bid responses that come back after [the timeout you configured during setup]({{site.github.url}}/dev-docs/getting-started.html#set-the-ad-server-timeout) will not be sent to the ad server.

{: .alert.alert-success :}
You can also [print this data to the console in table format]({{site.baseurl}}/dev-docs/troubleshooting-tips.html#see-all-bids-in-the-console) for easier reading.

![pbjs.getBidResponses() in browser console]({{site.github.url}}/assets/images/overview/prebid-troubleshooting-guide/bids.png "pbjs.getBidResponses()"){: .pb-lg-img :}

## Verify your Ad Server Targeting

After the auction on page has occurred, Prebid.js will set key-value targeting for the ad server for those bids that have been returned before the [timeout you configured during setup]({{site.github.url}}/dev-docs/getting-started.html#set-the-ad-server-timeout).

To see what values Prebid.js intends to send to the ad server, open your browser console and type `pbjs.getAdserverTargeting();` as shown below:

![pbjs.getAdserverTargeting() in browser console]({{site.github.url}}/assets/images/overview/prebid-troubleshooting-guide/ad-server-target.png "pbjs.getAdserverTargeting()"){: .pb-lg-img :}

{: .alert.alert-danger :}
Note that if no bids are returned, no key-values will be set. You may need to increase your timeout setting or reach out to your bidder partners to determine why no bid responses are being sent.

## Check the Ad Server's Auction

After the Prebid auction has occurred and key-values have been set for the ad server, the ad server will use the line items targeting those key-values within its auction.

If you're using Google Ad Manager, you can verify this by using the [Google Publisher Console](https://support.google.com/dfp_sb/answer/2462712?hl=en), which can be accessed as follows:

+ Open your browser's console and type `googletag.openConsole();`

+ Append `googfc` as a query parameter to the URL. Then, click the *Delivery Diagnostics* option to reveal most of the information described below.

To make sure your ad server is set up correctly, answer the following questions:

+ **How many ads have been fetched for an ad unit?** Ideally, only 1 ad will be requested on page load. If not, check for unnecessary extra calls to the ad server in your page's source code.

![Google Publisher Console Ad fetch count]({{site.github.url}}/assets/images/overview/prebid-troubleshooting-guide/ad-server-1.png "Google Publisher Console Ad fetch count"){: .pb-sm-img :}

+ **Are the key-values being set in the ad server?** If not, review your page's source code to ensure that the Prebid auction completes **before** sending the key-value targeting to the ad server.

![Google Ad Manager Delivery Troubleshooting]({{site.github.url}}/assets/images/overview/prebid-troubleshooting-guide/ad-server-2.png "Google Ad Manager Delivery Troubleshooting"){: .pb-lg-img :}

+ **Has the ad server order been activated?** If not, you'll have to activate the order to see Prebid-delivered ads.

+ **Are there other higher priority campaigns running within your ad server?** Higher priority campaigns will prevent Prebid ads with a higher CPM bid from winning in the ad server's auction. For testing purposes, you may want to pause these campaigns or have them excluded when the prebid key values are present.

+ **Is there other remnant inventory in the ad server with a higher CPM that is winning?** To test for this, you may want to use a test creative set up within a bidder partner that has a high CPM or create artificial demand with a [bidCPMadjustment]({{site.github.url}}/dev-docs/publisher-api-reference/bidderSettings.html).

+ **Have you set up all of the line items in the ad server to match the [setPriceGranularity setting]({{site.github.url}}/dev-docs/examples/custom-price-buckets.html) within Prebid.js?** All of the line items that correspond to your price granularity settings must be set up in your ad server. When there are gaps in the price granularity of your line item setup, bids will be reduced according to the size of the gap. For example, with [dense granularity]({{site.github.url}}/dev-docs/publisher-api-reference.html#dense-granularity), a $3.32 bid will be sent to the ad server as $3.30.

## Look for the Winning Bid

When a prebid line item wins the ad server's auction, a `renderAd` event will be logged in the browser console. To see this event, you need to do either of the following before the auction:

+ Have typed `pbjs.logging=true` into your your browser console

+ Appended `pbjs_debug=true` as a query parameter to the URL

When this event is logged, it shows that Prebid.js has requested to render the ad from the winning bidder partner, and that this partner's bid has won both the Prebid and ad server auctions.

![renderAd event in browser console]({{site.github.url}}/assets/images/overview/prebid-troubleshooting-guide/render-ad.png "renderAd event in browser console"){: .pb-lg-img :}

## Related Topics

+ [Developer Troubleshooting Tips]({{site.github.url}}/dev-docs/troubleshooting-tips.html)

+ [Common Setup Issues]({{site.github.url}}/dev-docs/common-issues.html)
Moved to a new [Troubleshooting Guide](/troubleshooting/troubleshooting-guide.html)
4 changes: 2 additions & 2 deletions dev-docs/publisher-api-reference/getNoBids.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ description:
---


Use this method to get all of the bid requests that resulted in a NO_BID. These are bid requests that were sent to a bidder but, for whatever reason, the bidder decided not to bid on. Used by debugging snippet in [Tips for Troubleshooting](/dev-docs/troubleshooting-tips.html).
Use this method to get all of the bid requests that resulted in a NO_BID. These are bid requests that were sent to a bidder but, for whatever reason, the bidder decided not to bid on. Used by debugging snippet in the [Troubleshooting Guide](/troubleshooting/troubleshooting-guide.html).

+ `pbjs.getNoBids()`: returns an array of bid request objects that were deliberately not bid on by a bidder.
+ `pbjs.getNoBids()`: returns an array of bid request objects that were deliberately not bid on by a bidder.
2 changes: 1 addition & 1 deletion dev-docs/publisher-api-reference/setConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Debug mode can be enabled permanently in a page if desired. In debug mode,
Prebid.js will post additional messages to the browser console and cause Prebid Server to
return additional information in its response. If not specified, debug is off.
Note that debugging can be specified for a specific page view by adding
`pbjs_debug=true` to the URL's query string. e.g. <code>/pbjs_demo.html?pbjs_debug=true</code> See [Prebid.js troubleshooting tips](/dev-docs/troubleshooting-tips.html) for more information.
`pbjs_debug=true` to the URL's query string. e.g. <code>/pbjs_demo.html?pbjs_debug=true</code> See [Prebid.js troubleshooting guide](/troubleshooting/troubleshooting-guide.html) for more information.

Turn on debugging permanently in the page:
{% highlight js %}
Expand Down
Loading