OpenAds Google Ad Manager integration
OpenAds supports using header-bidding technology through a Google Ad Manager (GAM) integration. This guide highlights GAM documentation and OpenAds differences to create line items and configure creatives in GAM.
Workflow overview
The following table summarizes the OpenAds GAM integration workflow and links to detailed instructions for each step.
| Step | Task | Notes |
|---|---|---|
| 1 | Create line items in GAM. | Header bidding trafficking does not support OpenAds, so you must generate line items. |
| 2 | Configure creatives in GAM. | OpenAds uses its own version of the Prebid Universal Creative. Use the provided configurations. |
The following sections provide instructions and relevant code samples for each step.
Create line items in GAM
IMPORTANT: Header bidding trafficking does not support OpenAds, so you must generate line items.
OpenAds runs the auction on-page and passes the winning bid back to the ad server using key value pairs, so the ad server must have line items targeting the key value pairs to serve the creative. Here's what you need to know about line items:
- Line item trafficking for OpenAds in Google Ad Manager is similar to Prebid.
- For targeting Price Priority line items, you must use OpenAds targeting keys with the
oa_prefix.
For details on line item setup, see Google Ad Manager with Prebid Step by Step in the Prebid documentation.
Configure creatives in GAM
TIP: We recommended listing up to five creatives per line item.
OpenAds uses its own version of the Prebid Universal Creative with the following configurations.
| Configuration | Creative Type |
|---|---|
| Send all bids |
|
| Send top price bid |
|
The following sections provide configuration-specific examples for banner and video ad creatives.
Send all bids: banner ads
For banner ad creatives in the "send all bids" configuration mode, use the following scripts:
<script src = "https://openads-cdn.adsrvr.org/openads-universal-creative/build/latest/%%PATTERN:oa_format%%.js"></script>
<script>
var ucTagData = {};
ucTagData.adServerDomain = "";
ucTagData.pubUrl = "%%PATTERN:url%%";
ucTagData.adId = "%%PATTERN:oa_adid_BIDDERCODE%%";
ucTagData.cacheHost = "%%PATTERN:oa_cache_host_BIDDERCODE%%";
ucTagData.cachePath = "%%PATTERN:oa_cache_path_BIDDERCODE%%";
ucTagData.uuid = "%%PATTERN:oa_cache_id_BIDDERCODE%%";
ucTagData.mediaType = "%%PATTERN:oa_format_BIDDERCODE%%";
ucTagData.env = "%%PATTERN:oa_env%%";
ucTagData.size = "%%PATTERN:oa_size_BIDDERCODE%%";
ucTagData.hbPb = "%%PATTERN:oa_pb_BIDDERCODE%%";
// The `mobileResize` property is required only for mobile GAM.
ucTagData.mobileResize = "%%PATTERN:oa_size_BIDDERCODE%%";
// The next two properties are required only for native creatives, but fine to include for banner ads.
ucTagData.requestAllAssets = true;
ucTagData.clickUrlUnesc = "%%CLICK_URL_UNESC%%";
try {
ucTag.renderAd(document, ucTagData);
} catch (e) {
console.log(e);
}
</script>
Send all bids: video ads
For in-stream video ad creatives in the "send all bids" configuration mode, use the following VAST redirect URL:
https://openads.adsrvr.org/cache?uuid=%%PATTERN:oa_uuid_BIDDERCODE%%
For details, see GAM Step by Step - Video Creatives in the Prebid documentation.
NOTE: The bidder code for The Trade Desk's adapter in OpenAds is
thetradedesk, so video creatives associated with our bids would look like this:https://openads.adsrvr.org/cache?uuid=%%PATTERN:oa_uuid_thetradedesk%%
Send top price bid: banner ads
For banner ad creatives in the "send top price bid" configuration mode, use the following scripts:
<script src = "https://openads-cdn.adsrvr.org/openads-universal-creative/build/latest/%%PATTERN:oa_format%%.js"></script>
<script>
var ucTagData = {};
ucTagData.adServerDomain = "";
ucTagData.pubUrl = "%%PATTERN:url%%";
ucTagData.targetingMap = %%PATTERN:TARGETINGMAP%%;
ucTagData.hbPb = "%%PATTERN:oa_pb%%";
// The next two properties are required only for native creatives, but fine to include for banner ads.
ucTagData.requestAllAssets = true;
ucTagData.clickUrlUnesc = "%%CLICK_URL_UNESC%%";
try {
ucTag.renderAd(document, ucTagData);
} catch (e) {
console.log(e);
}
</script>
Send top price bid: video ads
For in-stream video ad creatives in the "send top price bid" configuration mode, use the following VAST redirect URL:
https://openads.adsrvr.org/cache?uuid=%%PATTERN:oa_uuid%%
For details, see GAM Step by Step - Video Creatives in the Prebid documentation.
FAQs
The following are frequently asked questions about integrating with OpenAds using GAM.
How is OpenAds line item trafficking in GAM different from Prebid?
The process is similar to Prebid. However, OpenAds uses its own targeting key prefix (oa_) to prevent conflicts with Prebid targeting keys.
Which targeting keys should I use for OpenAds line items?
Use targeting keys with the oa_ prefix for Price Priority line items. These keys function like the hb_ keys in Prebid, but are specific to OpenAds. For example, as shown in the following table.
| OpenAds Key | Prebid Equivalent |
|---|---|
oa_pb |
hb_pb |
oa_size |
hb_size |
oa_bidder |
hb_bidder |
How do I upload VAST creatives for in-stream video ads?
Use the appropriate redirect URL for your chosen configuration mode based on the following options:
- Send all bids: Video ads
- Send top price bid: Video ads
What's the bidder code for The Trade Desk's bid adapter in OpenAds?
The bidder code for our bid adapter in OpenAds is thetradedesk.