Features in Beta phase might not be available in your network. Watch the release notes for when this feature becomes generally available.
This article explains how to use external Content Delivery Networks (CDNs) to deliver ad media for live streams using Google Ad Manager Dynamic Ad Insertion (DAI) .
On this page
- Overview of this feature
- How it works
- External CDN requirements and configuration
- Google Ad Manager configuration
- FAQs
Overview of this feature
Publishers using Google Ad Manager DAI typically rely on Google's Ad CDN for ad delivery. This feature allows publishers to use a CDN of their choice instead. This offers several benefits:
- Multi-CDN support:Use different CDNs for different regions or based on performance, improving global reach and redundancy. This is important for large-scale live events.
- Improved performance:Using CDNs optimized for specific locations can lead to faster ad load times and better viewer experience.
- Unified content and ad delivery:Using the same CDN for content and ads simplifies operations and may improve performance with a single SSL connection. It also lets CDNs better monitor traffic and adjust routing.
How it works
Setup involves configuring the external CDN to use Google's Ad CDN as an origin server for ad media, and potentially configuring Google Ad Manager. Ad delivery is then achieved by:
- Player request:The player requests the ad from the publisher's CDN.
- CDN lookup:The CDN checks its cache for the ad.
- Origin request:If the ad is not cached, the CDN requests it from Google's Ad CDN.
- Ad delivery:Google's Ad CDN delivers the ad, which is cached by the publisher's CDN and served to the player.
Ordered flow steps
- Video player requests manifest from DAI
- DAI returns manifest with URLs (pointing to DAI)
- Video player requests segment URL
- DAI returns HTTP 302 redirect to the publisher's external CDN
- Publisher's CDN requests ad segment URL (following DAI redirect)
- Publisher's CDN checks cache
If there is a cache miss:
- Publisher's CDN requests ad segment from Google origin server
- Google origin server returns HTTP 302 redirect to optimal Google CDN node
- Publisher's CDN requests ad segment from Google CDN node (following Google origin redirect)
- Google CDN node returns ad segment data to publisher's CDN
- Publisher's CDN caches ad segment
- Publisher's CDN returns ad segment data to the video player
If there is a cache hit when the publisher's CDN checks cache, ad segment data is returned to the video player.
External CDN requirements and configuration
The external CDN must:
- Support HTTPS redirects (302s)
- Respect cache control headers
- The Google Origin Server
redirector.googlevideo.com
returns a cache-control header with a private directive.Example
Unset
Cache-Control: private, max-age=85908
-
Your CDN configuration should disregard the "private" directive but respect the max-age.
-
For Akamai setups, turn off the "honor private" setting.
- The Google Origin Server
- Allow configurable cache keys based on URL components
- Do NOT cache any responses that are not HTTP 200.
The external CDN must be set up to request ad media from redirector.googlevideo.com
(Google's Ad CDN) as the origin server. You should consult your CDN's documentation for specific instructions. The cache key should be configured as the entire URL path, excluding any path prefix specified by DAI (for example, the value of the dai-aup
parameter). Query parameters must be ignored for caching.
Google Ad Manager configuration
Important: Validate your setup before you go live
When using this feature, you should ensure the utmost caution while setting up external CDN configurations and passing the correct values for the dai-aup
query parameter. The DAI product isn't able to identify any mistakes in your configuration or query parameter. Incorrect setup or values lead to broken playback and potential revenue impact.
We urge you to do a through review of your CDN configurations and conduct comprehensive playback testing before rolling out this feature on your live stream events. We recommend rolling out this features in an incremental manner making sure no playback is broken and tracking pings are correctly making it to ad servers.
There are two approaches for CDN integration in Google Ad Manager DAI, using different query parameters during stream creation: dai-ad-dlid
or dai-aup
. You can learn more about these parameters here, or decide which parameter to use
.
Use a dedicated CDN ID per stream ( dai-ad-dlid
)
With this approach, a specific, pre-configured CDN is associated with a live stream in Google Ad Manager. The CDN is identified by a unique ID defined during CDN configuration in Google Ad Manager. This ID is passed as the dai-ad-dlid
parameter during stream creation.
The use of the dai-ad-dlid
parameter requires that you create CDN configurations
with details like the hostname for each external CDN.
dai-ad-dlid
- Granular control:Allows using different CDNs for different streams.
- Simplified stream creation:Only the CDN ID is needed after initial CDN configuration in Google Ad Manager.
- Potential for default CDN setup:A default ad delivery CDN can be set at the live stream event level.
- More setup:Requires upfront configuration in Google Ad Manager.
- Less flexible:Changing the CDN requires modifying the stream configuration.
Use an arbitrary URL prefix ( dai-aup
)
dai-aup
is currently the only option for external CDN ad delivery when using pod serving
. If you use full service DAI, this parameter takes precedence over the dai-ad-dlid
parameter if both are present.With this approach, an arbitrary URL prefix, pointing to the external CDN, is used to construct ad segment URLs. This prefix is passed as the dai-aup
parameter during stream creation. Google's DAI replaces the usual CDN URL with a URL using this prefix, which must:
- Be in the format of "
https://domain.com/path/
" where "/path/
" is optional - Be an absolute URL prefix (relative URLs are not supported)
Example
dai-aup=https://domain.com/path-c1/path-c2
Google CDN URL: https://redirector.googlevideo.com/videoplayback/foo?bar=baz
Resulting ad segment URL: https://domain.com/path-c1/path-c2/videoplayback/foo?bar=baz
No specific Google Ad Manager configuration is needed.
dai-aup
- Flexibility:CDNs can be changed without modifying stream configurations (just change the URL prefix).
- Simpler setup:There is no need to pre-configure CDNs in Google Ad Manager.
- Less granular control:Less control over which CDN is used for each stream.
- Potential URL management complexity:Careful management of URL prefixes is needed when using multiple CDNs dynamically.
Decide which parameter to use
The best approach depends on your needs and CDN management strategy. Consider the trade-offs between granular control and flexibility. In general, it's recommended that you:
Choose dai-ad-dlid
if:
- Granular control over CDN selection per stream is needed.
- Simpler stream creation after initial setup is preferred.
- The ability to configure default CDNs in Google Ad Manager is desired.
Choose dai-aup
if:
- Maximum flexibility to change CDNs dynamically is needed.
- Extra configuration steps in Google Ad Manager should be avoided.
FAQs
Is it a prerequisite for Content Delivery Networks (CDNs) for both content and ad segments to be identical for this configuration to function correctly?
While not a strict prerequisite, using the same CDN for both content and ad segments offers significant performance benefits. Here's why:
- Faster ad starts:An existing connection to the CDN for the main content eliminates the need for a new DNS lookup and connection handshake when an ad break starts, leading to quicker ad playback.
- Enhanced stability:The CDN's established load balancing for the content stream can seamlessly manage ad requests. This prevents a sudden surge of traffic that could otherwise overwhelm servers, mitigating the "thundering herd" effect.