# Sending Google Ad Manager signals through third-party ad servers

If you use a third-party ad server with Google Ad Manager server-side ad
insertion (SSAI), IMA supports monetizing additional inventory through Google Ad
Manager by sending an encrypted nonce through the third-party ad server to
Ad Manager. This guide shows how to send these signals using the IMA SDK.

> [!IMPORTANT]
> **Key Term:** For this guide, a "third-party ad server" is any non-Google Ad Manager ad server.

This guide uses an example ad tag:
`https://youradserver.com`.
You need to update the ad tag to work with your actual ad servers.

## Prerequisites

- IMA HTML5 SDK
  v3.523.0 or higher.

- Complete the [Get started guide](https://developers.google.com/ad-manager/dynamic-ad-insertion/sdk/html5).

## 1. Configure your app to send a nonce to Google's DAI servers

Set `enableNonce` to `true` to have the IMA DAI SDK send an encrypted nonce to
DAI servers.

    const streamRequest = new LiveStreamRequest();
    streamRequest.enableNonce = true;

## 2. Update ad tag with a macro to populate the nonce

Add the macro `[GOOGLE_INSTREAM_VIDEO_NONCE]` to your ad server's tag in the Ad
Manager UI. When the DAI server populates the ad breaks with your third-party ad
server URLs, Ad Manager will dynamically populate the macro with the encrypted
nonce. The result should look similar to the following sample ad tag, which uses
a key that must be configured on the third-party server:

```
https://youradserver.com?ad_manager_nonce=[GOOGLE_INSTREAM_VIDEO_NONCE]
```

This ad tag uses `ad_manager_nonce` as an example key, but you'll need to
confirm with your third-party ad server on how it accepts the nonce value.

To update your ad server's tag in Ad Manager, go to **Video \> Livestreams** and
select an active livestream or
[create a new one](https://support.google.com/admanager/answer/7294289).

Now, add the macro to the ad tag configured within the selected stream. Set the
tag in **Ad Break Settings \> Master Ad Tag**.

## 3. Configure the third-party ad server's request for Ad Manager

Configure your third-party ad server to include the nonce in the server's
request to Ad Manager. Here's an example of an ad tag configured inside of the
third-party ad server:

```
https://pubads.g.doubleclick.net/gampad/ads?givn=%%custom_key_for_google_nonce%%&iu=/21775744923/external/single_ad_samples&sz=640x480
```

Ad Manager looks for `givn=` to identify the nonce value. The third-party ad
server will need to support some macro of its own, such as
`%%custom_key_for_google_nonce%%`, and replace it with the nonce query parameter
you provided in the previous step. More information on how to accomplish this
should be available in the third-party ad server's documentation.

> [!NOTE]
> **Note:** This guide uses two macros.
>
> 1. The ad requests to your third-party ad servers should contain the `[GOOGLE_INSTREAM_VIDEO_NONCE]` macro. This ad tag is stored in the Ad Manager UI. IMA SDK searches (with case sensitive, exact match) and replaces this macro with the encrypted nonce.
> 2. The second macro, `%%custom_key_for_google_nonce%%`, is used by your third-party ad server to fill in the encrypted nonce for the request to Google Ad Manager. This macro is an example, and can be configured to any string your third-party ad server accepts.

That's it! You should now have the nonce parameter propagated from the IMA DAI
SDK through the DAI server, to the third-party ad server, and back to Ad
Manager. This enables better monetization through Google Ad Manager.