Skip to content

Commit 55198b0

Browse files
ChrisHuiebretg
andauthored
Add example of bid filtering on meta object (prebid#3123)
* Add example of bid filtering on meta object * add fiddle link * embedded * add code height * update sidebar yaml * tweaks, removing old troubleshooting-tips * typo Co-authored-by: bretg <bgorsline@gmail.com>
1 parent 18e9a68 commit 55198b0

13 files changed

Lines changed: 86 additions & 370 deletions

File tree

_data/sidebar.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,15 @@
234234
isSectionHeader: 0
235235
sectionTitle:
236236
subgroup: 1
237+
238+
- sbSecId: 1
239+
title: Meta Bid Filtering
240+
link: /dev-docs/examples/meta-bid-filtering.html
241+
Item: 1
242+
isHeader: 0
243+
isSectionHeader: 0
244+
sectionTitle:
245+
subgroup: 1
237246

238247
- sbSecId: 1
239248
title: Troubleshooting

_layouts/example.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,11 @@ <h4>This page contains:</h4>
4343
</ul>
4444
</p>
4545

46-
<p>
47-
On the JSFiddle example below, click <strong>Result</strong> to see the result.
48-
</p>
49-
50-
<p>
51-
Click <strong>Edit in JSFiddle</strong> to open the example in a new tab.
52-
</p>
53-
5446
<p>
5547
For tips and troubleshooting info, see:
5648
<ul>
5749
<li>
58-
<a href="{{site.github.url}}/dev-docs/troubleshooting-tips.html">Tips for Troubleshooting</a>
50+
<a href="/troubleshooting/troubleshooting-guide.html">Troubleshooting Guide</a>
5951
</li>
6052
<li>
6153
<a href="{{site.github.url}}/dev-docs/common-issues.html">Common Issues</a>
@@ -71,6 +63,14 @@ <h4>This page contains:</h4>
7163
</div>
7264
</div>
7365

66+
<p></p>
67+
<p>
68+
On the JSFiddle example below:
69+
<ul><li>click 'Result' to see the output of the page.</li>
70+
<li>Click 'Edit in JSFiddle' to open the example in a new tab.</li></ul>
71+
</p>
72+
73+
7474
<div class="row">
7575
<!-- JSFiddle -->
7676
<div id="jsfiddle" class="col-md-12">

debugging/debugging.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,3 @@ benefit from implementation improvements.
2121
Further Reading
2222

2323
+ [Prebid.js Troubleshooting Guide]({{site.github.url}}/dev-docs/prebid-troubleshooting-guide.html)
24-
+ [Prebid.js Troubleshooting Tips]({{site.github.url}}/dev-docs/troubleshooting-tips.html)

dev-docs/common-issues.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,6 @@ Check the bid prices. If they are low and are getting reduced to $0 due to price
3838
{:toc}
3939

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

4343

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
layout: example
3+
title: Meta Bid Filtering
4+
description: Bid filtering on meta object example
5+
sidebarType: 1
6+
7+
8+
about:
9+
- Filter particular values or if meta object is provided
10+
- Integration with single Google Ad Manager ad slot
11+
- Default price granularity
12+
13+
jsfiddle_link:
14+
https://jsfiddle.net/Prebid_Examples/0s4eug1d/18/embedded/html,result
15+
16+
code_height:
17+
2300
18+
---
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
layout: example
3+
title: Meta Bid Filtering
4+
left_nav_override: Examples
5+
description: Bid filtering on meta object example
6+
sidebarType: 1
7+
8+
about:
9+
- 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.
10+
- This is an example that filters bid responses based on the metadata object.
11+
12+
jsfiddle_link: jsfiddle.net/Prebid_Examples/0s4eug1d/18/embedded/html,result
13+
14+
code_height: 2300
15+
---

dev-docs/faq.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,11 @@ It's technically possible, but we don't recommend doing this:
160160
161161
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)
162162
163+
## Can I filter bid responses that don't meet my criteria?
164+
165+
Yes. Many bidders provide metadata about the bid that can be used in troubleshooting
166+
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).
167+
163168
## Does Prebid.js resolve the AUCTION_PRICE macro?
164169
165170
Yes, but in a way that could cause discrepancies in reporting. It's recommended
@@ -168,9 +173,8 @@ that [bid adapters resolve OpenRTB macros](/dev-docs/bidder-adaptor.html#resolve
168173
For historic reasons, Prebid will resolve the AUCTION_PRICE macro, but it will be after currency conversion and any bid adjustments.
169174
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.
170175
171-
172176
## Related Reading
173177
174-
+ [Prebid.js Dev Tips]({{site.baseurl}}/dev-docs/troubleshooting-tips.html)
175-
+ [Prebid.js Common Issues]({{site.baseurl}}/dev-docs/common-issues.html)
178+
+ [Prebid.js Troubleshooting Guide](/troubleshooting/troubleshooting-guide.html)
179+
+ [Prebid.js Common Issues](/dev-docs/common-issues.html)
176180
+ [Prebid.js issues tagged 'question'](https://github.com/prebid/Prebid.js/issues?utf8=%E2%9C%93&q=is%3Aissue%20label%3Aquestion%20)

dev-docs/prebid-troubleshooting-guide.md

Lines changed: 1 addition & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
layout: page_v2
33
title: Prebid.js Troubleshooting Guide
44
head_title: Prebid.js Troubleshooting Guide
5-
description: How to troubleshoot Prebid.js from the perspective of an ad call from start to finish.
6-
pid: 10
7-
top_nav_section: dev_docs
8-
nav_section: troubleshooting
95
sidebarType: 1
106
---
117

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

17-
{: .alert.alert-danger :}
18-
Prebid.org does not support any version of Prebid.js prior to version 1.0.
19-
20-
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.
21-
22-
* TOC
23-
{:toc}
24-
25-
## Check Your Prebid Version
26-
27-
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;`.
28-
29-
You can reference this against the changes listed in the [Prebid.js Release Notes](https://github.com/prebid/Prebid.js/releases).
30-
31-
## Delay the Ad Server Call so Key-Values can be Set
32-
33-
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.
34-
35-
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.
36-
37-
{% highlight js %}
38-
var googletag = googletag || {};
39-
googletag.cmd = googletag.cmd || [];
40-
googletag.cmd.push(function() {
41-
googletag.pubads().disableInitialLoad();
42-
});
43-
{% endhighlight %}
44-
45-
## Check the Ad Units on the Page
46-
47-
Make sure the ad units configured for Prebid.js match up with the ad units that have been set up in your ad server.
48-
49-
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:
50-
51-
![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 :}
52-
53-
## List your Bids and Bidders
54-
55-
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.
56-
57-
To see all of the winning bids, open your browser console and type [`pbjs.getAllWinningBids();`]({{site.baseurl}}/dev-docs/publisher-api-reference/getAllWinningBids.html).
58-
59-
{: .alert.alert-danger :}
60-
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.
61-
62-
{: .alert.alert-success :}
63-
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.
64-
65-
![pbjs.getBidResponses() in browser console]({{site.github.url}}/assets/images/overview/prebid-troubleshooting-guide/bids.png "pbjs.getBidResponses()"){: .pb-lg-img :}
66-
67-
## Verify your Ad Server Targeting
68-
69-
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).
70-
71-
To see what values Prebid.js intends to send to the ad server, open your browser console and type `pbjs.getAdserverTargeting();` as shown below:
72-
73-
![pbjs.getAdserverTargeting() in browser console]({{site.github.url}}/assets/images/overview/prebid-troubleshooting-guide/ad-server-target.png "pbjs.getAdserverTargeting()"){: .pb-lg-img :}
74-
75-
{: .alert.alert-danger :}
76-
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.
77-
78-
## Check the Ad Server's Auction
79-
80-
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.
81-
82-
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:
83-
84-
+ Open your browser's console and type `googletag.openConsole();`
85-
86-
+ Append `googfc` as a query parameter to the URL. Then, click the *Delivery Diagnostics* option to reveal most of the information described below.
87-
88-
To make sure your ad server is set up correctly, answer the following questions:
89-
90-
+ **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.
91-
92-
![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 :}
93-
94-
+ **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.
95-
96-
![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 :}
97-
98-
+ **Has the ad server order been activated?** If not, you'll have to activate the order to see Prebid-delivered ads.
99-
100-
+ **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.
101-
102-
+ **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).
103-
104-
+ **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.
105-
106-
## Look for the Winning Bid
107-
108-
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:
109-
110-
+ Have typed `pbjs.logging=true` into your your browser console
111-
112-
+ Appended `pbjs_debug=true` as a query parameter to the URL
113-
114-
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.
115-
116-
![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 :}
117-
118-
## Related Topics
119-
120-
+ [Developer Troubleshooting Tips]({{site.github.url}}/dev-docs/troubleshooting-tips.html)
121-
122-
+ [Common Setup Issues]({{site.github.url}}/dev-docs/common-issues.html)
13+
Moved to a new [Troubleshooting Guide](/troubleshooting/troubleshooting-guide.html)

dev-docs/publisher-api-reference/getNoBids.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ description:
55
---
66

77

8-
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).
8+
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).
99

10-
+ `pbjs.getNoBids()`: returns an array of bid request objects that were deliberately not bid on by a bidder.
10+
+ `pbjs.getNoBids()`: returns an array of bid request objects that were deliberately not bid on by a bidder.

dev-docs/publisher-api-reference/setConfig.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Debug mode can be enabled permanently in a page if desired. In debug mode,
5252
Prebid.js will post additional messages to the browser console and cause Prebid Server to
5353
return additional information in its response. If not specified, debug is off.
5454
Note that debugging can be specified for a specific page view by adding
55-
`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.
55+
`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.
5656

5757
Turn on debugging permanently in the page:
5858
{% highlight js %}

0 commit comments

Comments
 (0)