This guide contains step-by-step instructions for manually setting up line items in Google Ad Manager (GAM) to work with Prebid. These instructions describe only the specific settings required for Prebid, they are not intended to be comprehensive instructions that replace or duplicate the GAM documentation.
Because integrating with Prebid could mean having to create thousands of line items, most companies will automate these steps. We’re showing them here so you can manually create the line items if you need or want to, and also to provide context for the automation.
Prebid provides a script you can use to automate these steps: Prebid Line Item Manager.
Before you begin, we recommend you read through our Planning Guide to make sure you know what your configuration is going to look like and you’ve thoroughly documented your decisions.
GAM works as a hierarchical structure, where line items are children of orders, and orders are children of advertisers. You must have your advertisers and orders set up before you can start creating line items and creatives. The advertisers you create for Prebid will typically depend on whether you’re sending all bids or only the top price bid to the ad server.
If you’re working with native inventory, you must have your native template created and stored before you begin creating your line item. See GAM Step by Step - Native Creatives.
When you create your line item, you’ll be targeting key-value pairs that are being sent with the ad request to the ad server. Any keys you target need to be defined in GAM before you can use them in your line items.
To define new keys, in GAM go to Inventory > Key-Values and enter your Prebid-specific keys, e.g. hb_pb
, hb_adid
, hb_size
, hb_format
, etc.
You can also define accepted values for the keys, but you don’t need to. If you create Dynamic keys, values can be added when you set up your line item.
Keys in GAM have a maximum length of 20 characters; any keys passed to GAM longer than that will be truncated. This means that if Prebid passes in the key hb_format_BidderWithALongName
, GAM will truncate it to hb_format_BidderWith
. When you create your keys, you must use the truncated name.
See Key Values for information on the keys you’ll need.
Open the order you want to associate the line item with and click New line item.
From the Settings tab, do the following:
Enter the Name of your line item. Suggested format: Prebid – format - bidder – price bucket. For example, Prebid – banner - BidderA - 1.50
.
Set the Line Item Type to Price priority (12). (This will most likely be higher for deals. See Deals in Prebid for more information.)
For Long-Form (OTT) Video: If you’re using competitive exclusions, under Additional settings enter the value for competitive exclusions in the Label field. This value will be included in your targeting within the value for the hb_pb_cat_dur
key. See Targeting below for more information.
Under Delivery settings:
Under Add targeting, expand Custom targeting.
These instructions assume you’re sending all bids to the ad server (the default). If you’re sending only the top price bid, your targeting keys will not include the bidder code. For example, rather than targeting price buckets with hb_pb_BidderA
, you’ll target hb_pb
. See Send All Bids vs Top Price for more information.
Select the price bucket key: hb_pb_BIDDERCODE (where BIDDERCODE is the actual code for your bidder, such as hb_pb_BidderA
).
Leave is any of and enter (or select) your price bucket.
The following additional keys must be added for the corresponding formats:
Banner/Outstream/Native:
You can use the same line item for banner, outstream, and/or native creatives. If your ad slot could be filled by two or more of these formats, you must include the hb_format key with values specifying all expected formats. Select hb_format_BIDDERCODE > is any of > video, banner, native.
If you combine native with another format in a single line item, you’ll need to add creative-level targeting to designate which creatives target which format. See Creative-level Targeting below.
In-Player and Outstream Video:
Both in-player (instream) and outstream video ads supply the hb_format_BIDDERCODE=video
key-value pair, so targeting on that key alone is not enough to choose the correct line items. If you’re running both instream and outstream video ads, they will most likely be separate line items, so you will need to target outstream line items to either “Inventory Type=display” or “Inventory in (list of GAM AdUnits)”.
Long-Form (OTT) Video:
For long-form video the custom key hb_pb_cat_dur_BIDDERCODE is required. The value of this key breaks down like this:
For example, for a line item with a $10.00 CPM entered in the Rate field, a Label of “news”, and 30s entered in the Duration field, you would enter the following in the Custom key-value field: hb_pb_cat_dur_BIDDERCODE = 10.00_news_30s
. If you’re not using competitive exclusion, you can have a value such as this: hb_pb_cat_dur_BIDDERCODE = 10.00_30s
.
For deals, the Rate portion of this value will contain the dealID if deals are prioritized. See Getting Started with Long Form Video for engineering information.
Engineers will need to include the Adpod module and the Category Translation module in Prebid.js to implement long-form video bidding.
In the Expected Creatives section, you can add targeting that applies to creatives rather than to the entire line item. For Prebid you might want to do this if you’re going to use a single line item for multiple formats, or if you have multiple video cache locations.
To set creative-level targeting, do the following:
Repeat the preceding steps for each creative in the line item.
You’ve now added all fields necessary for targeting Prebid line items. You can add any other line item options you would normally use, such as additional targeting for geography. When you’ve filled in all the above fields, click Save to save your line item.
The process you use to create your creatives differs based on the media type. Follow the instructions for the appropriate media type:
After you’ve created your creatives, you’ll need to associate a creative with each size in your line item. Even if you’ve specified only one or two sizes, you might actually want more creatives than you have sizes. Because the creative body itself is identical no matter which size you’re associating it with, you can duplicate the creative so you have as many as you need.
You need extra copies of the creative because GAM will display only one creative per line item per page. See Creative Considerations for more information.
Prebid – banner – 1x1 – 1
, Prebid – banner – 1x1 – 2
, etc.Now we need to attach the creatives to your line item. Navigate to Delivery > Line items and select the line item you created earlier.
Under the Creatives tab, you’ll see a yellow box showing each size you entered for your line item that doesn’t yet have a creative attached. For each size in the list, do the following:
Repeat the preceding steps until all the sizes in your line item have creatives associated with them. When you’re done, the Creatives tab under your line item will show a list of all the associated creatives.
You’ve now created a line item for one price bucket for a single bidder. Next you need to create line items for the rest of the price buckets for that bidder. The simplest way to do that (outside of automation) is to duplicate the line item you just created.
You now need to click into each line item to change the following values to reflect the new price bucket:
If you’re using a Send Top Price cofiguration, at this point you’re done. Congratulations!
If you’re using a Send All Bids configuration, you need to repeat all the above steps for each of your bidders. You can copy one of the existing creatives and change the BIDDERCODE, and you can copy the existing line items and change the names, so you don’t have to completely start from scratch.