The Ad Break API lets you set the ad tag parameters using ad break parameters,
which enhances ad targeting accuracy and integration with ad servers.

## Override ad tag parameters

To override the ad tag parameters of the Google DAI stream, set the
`breakParams.adTagParams` field of the ad break. For more information, see
[Supply targeting parameters to your stream](https://support.google.com/admanager/answer/7320899)
and
[All VAST ad tag parameters](https://support.google.com/admanager/answer/10678356).

The following example shows a DAI stream's ad tag containing the
[`mridx` (mid-roll number)](https://support.google.com/admanager/answer/10678356#mridx)
query parameter:

    https://pubads.g.doubleclick.net/gampad/live/ads?mridx=3&...

The following example request creates an ad break that overrides the `mridx`
targeting value:

    curl -X POST "https://admanagervideo.googleapis.com/v1/adBreak/networks/NETWORK_CODE/assets/ASSET_KEY/adBreaks" \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer OAUTH_TOKEN" \
      -d '{
        "expectedDuration": "30s",
        "expectedStartTime": "2025-06-03T15:00:00Z",
        "scte35CueOut": "/DA0AAAAAAAA///wBQb+cr0AUAAeAhxDVUVJSAAAjn/PAAGlmbAICAAAAAAsoKGKNAIAmsnRfg==",
        "breakParams": {
          "adTagParams": [
            {"key": "mridx", "value": "7"},
            {"key": "ptpln", "value": "podtemplate"},
            {"key": "cust_params", "value": "param1=value1&param2=value2"}
          ]
        }
      }'

Replace the following:

- `NETWORK_CODE`: your Google Ad Manager network code. For more information, see [Ad Manager network code](https://support.google.com/admanager/answer/7674889#network-code).
- `ASSET_KEY`: your livestream event's asset key. For more information, see [Locate live linear stream URL and asset key](https://support.google.com/admanager/answer/7294289).
- `OAUTH_TOKEN`: your access token. For more information, see [Authenticate with OAuth2](https://developers.google.com/ad-manager/dynamic-ad-insertion/api/ad-break/use-ad-break-api#authenticate_with_oauth2).

> [!NOTE]
> **Note:** If you use Google Ad Manager as your ad server, see [All VAST ad tag parameters](https://support.google.com/admanager/answer/10678356). For third-party ad servers, refer to your ad server documentation.

## Expand ad tag with DAI macros

Google DAI supports ad tag macros in the `%%DAI_PATTERN:MACRO_NAME%%` format.
The macro name must be in `UPPER_CASE` format, containing uppercase letters,
numbers, and underscores only.

You can insert these macros in the Google DAI stream's ad tag or the DAI
stream request to set the macros with the values in your `breakParams.macros`
field.

The following example shows a Google DAI stream's ad tag containing a
`BREAK_TYPE` macro:

    https://pubads.g.doubleclick.net/gampad/live/ads?iu=/21775744923/external/single_ad_samples/%%DAI_PATTERN:BREAK_TYPE%%&...

The following request updates an ad break and sets the `BREAK_TYPE` macro
value:

    curl -X PATCH 'https://admanagervideo.googleapis.com/v1/adBreak/networks/NETWORK_CODE/assets/ASSET_KEY/adBreaks/AD_BREAK_ID' \
      -H 'Content-Type: application/json' \
      -H 'Authorization: Bearer OAUTH_TOKEN' \
      -d '{
        "name": "networks/.../assets/.../adBreaks/bcc402a6-9880-4b8b-8e4a-a8cd3688f854",
        "expectedDuration": "30s",
        "expectedStartTime": "2025-06-03T15:10:00Z",
        "scte35CueOut": "/DA0AAAAAAAA///wBQb+cr0AUAAeAhxDVUVJSAAAjn/PAAGlmbAICAAAAAAsoKGKNAIAmsnRfg==",
        "breakState": "BREAK_STATE_SCHEDULED",
        "breakParams": {
          "adTagParams": [
            {"key": "ptpln", "value": "podtemplate"},
            {"key": "cust_params", "value": "param1=value1&param2=value2"}
          ],
          "macros": [{"key": "BREAK_TYPE", "value": "national"}]
        }
      }'

Replace `AD_BREAK_ID` with your ad break ID.

Google DAI resolves the ad tag with the macro as follows:

    https://pubads.g.doubleclick.net/gampad/live/ads?iu=/21775744923/external/single_ad_samples/national&...

### Expand ad tag with SCTE-35 macros

When setting up your Google DAI livestream event, you can place
[SCTE-35 macros](https://support.google.com/admanager/answer/10138654#scte-35&zippy=%2Cscte-)
in the master ad tag.

When the livestream event starts, you can insert SCTE-35 data in the content
manifest or call the DAI Ad Break API with the SCTE-35 data included in the
`scte35CueOut` parameter. Google DAI uses the decoded data to populate the
SCTE-35 macros in the ad tag.

The following example uses the `%%TIME_SIGNAL_UPID_RAW%%` macro:

    https://pubads.g.doubleclick.net/gampad/live/ads?iu=/21775744923/external/single_ad_samples/%%TIME_SIGNAL_UPID_RAW%%&...

> [!NOTE]
> **Note:** To create the SCTE-35 metadata and insert the UPID raw string into your video stream, refer to your encoder or video stitcher manual.

The following example uses JSON to illustrate SCTE-35 timed signal data:

    {
      "splice_info_section": {
        ...
        "splice_command": {
          "command_name": "time_signal",
          "splice_time": {
            "time_specified_flag": 1,
            "pts_time": "123456789"
          }
        },
        "splice_descriptors": [
          {
            ...
            "segmentation_upid": {
              "raw_hex": "0x6E6174696F6E616C", // UTF8 value: national
              ...
            }
          }
        ]
      }
    }

Google DAI resolves the ad tag with the SCTE-35 macro as follows:

    https://pubads.g.doubleclick.net/gampad/live/ads?iu=/21775744923/external/single_ad_samples/national&...