Dynamic ad insertion (DAI) authentication keys are used to prove that video stream requests are coming from you. They provide better security during ad serving. A key is an unbroken string of 64 characters and numbers. Some older keys may be 25 characters or numbers.
For example:
0L94DEA6C87B0F3D2407018ACF88ECDE77DK38AD1DX01957311A50E9D1O3F15B
There are two options when creating an authentication key, and the procedure is the same for both:
Static API keys: API keys take precedence over HMAC when both are included. API keys are less secure than HMAC keys. Use of HMAC keys is therefore recommended.
HMAC (Beta) : HMAC-based token authentication provides more security than staticAPI keys. HMAC tokens use a secret key and limited duration to ensure the token cannot be easily shared across users or sessions.
Add a new authentication key
- Sign in to Google Ad Manager.
- Click Admin Video DAI authentication keys.
- Click New authentication key.
- Enter a Name that will help you identify this key.
- Select the type of authentication key—either API or HMAC.
API keys take precedence over HMAC when both are included. API keys are less secure than HMAC keys.
- Click Save.
To view and copy your key, return to the details page. Once you create an active DAI authentication key, you can use it immediately. Embed the key where ads are dynamically inserted.
Keys are automatically set to "Active" upon save. Only correctly implemented "Active" keyscan validate requests.
Requests using deactivated keys are denied. Only deactivate a key if it becomes compromised or should not be used.
Deactivate an existing authentication key
- Sign in to Google Ad Manager.
- Click Admin Video DAI authentication keys.
- Click the name of the key you want to deactivate.
- Select Inactive as the status.
- Click Save.
Implement an authentication key
HMAC keys (Beta)
Learn how to implement HMAC authentication.
API keys
Use the IMA SDK to set the apiKey
property on the IMAStreamRequest
object. See the iOS, Android, Chromecast, or tvOS developer documentation for more information.
For server-side beaconing (SSB), use the api-key
query parameter:
curl "https://dai.google.com/ondemand/hls/content/CMS_ID/vid/VIDEO_ID/master.m3u8?api-key=<api-authentication-key>"