Manages a nonce and event reporting for a single content playback session. To enable automated monetization, call the following content playback lifecycle methods:

- `sendAdClick`
- `sendAdTouch`
- `sendPlaybackStart`
- `sendPlaybackEnd`

| Methods ||
|---|---|
| `https://developers.google.com/ad-manager/pal/ctv/reference/interface/goog.ctv.pal.NonceManager#goog.ctv.pal.NonceManager.getNonce` |   |
| `https://developers.google.com/ad-manager/pal/ctv/reference/interface/goog.ctv.pal.NonceManager#goog.ctv.pal.NonceManager.sendAdClick` | Notifies Google ad servers that a clickthrough on an ad has occurred during the given content playback session. |
| `https://developers.google.com/ad-manager/pal/ctv/reference/interface/goog.ctv.pal.NonceManager#goog.ctv.pal.NonceManager.sendAdImpression` | **Deprecated.**Notifies Google ad servers that you are displaying the first frame of the ad. |
| `https://developers.google.com/ad-manager/pal/ctv/reference/interface/goog.ctv.pal.NonceManager#goog.ctv.pal.NonceManager.sendAdTouch` | Notifies Google ad servers of a user touch or click on the ad, for example, skip, mute, and tap, during the given content playback session. |
| `https://developers.google.com/ad-manager/pal/ctv/reference/interface/goog.ctv.pal.NonceManager#goog.ctv.pal.NonceManager.sendPlaybackEnd` | Notifies Google ad servers that playback for the given content playback session has ended. |
| `https://developers.google.com/ad-manager/pal/ctv/reference/interface/goog.ctv.pal.NonceManager#goog.ctv.pal.NonceManager.sendPlaybackStart` | Notifies Google ad servers that playback for the given content playback session has started. |

## Methods

*** ** * ** ***

### getNonce

`getNonce(): string`

| Returns ||
|---|---|
| `string` | The nonce generated for this manager. This value never changes for a given `NonceManager` instance. This nonce value is only valid for a single content playback session up to a maximum six hour duration. |

*** ** * ** ***

### sendAdClick

`sendAdClick(): void` Notifies Google ad servers that a clickthrough on an ad has occurred during the given content playback session.

*** ** * ** ***

### sendAdImpression

`sendAdImpression(): void` Notifies Google ad servers that you are displaying the first frame of the ad. This ad is the ad you request using the nonce that this `NonceManager` instance generates.

> [!WARNING]
> **Deprecated:** Use `sendPlaybackStart` and `sendPlaybackEnd` instead.

*** ** * ** ***

### sendAdTouch

`sendAdTouch(clickOrTouchEvent: MouseEvent | TouchEvent): void` Notifies Google ad servers of a user touch or click on the ad, for example, skip, mute, and tap, during the given content playback session. This ad interaction is different from a clickthrough, where the user clicks on the ad to navigate to the advertiser's site.

| Parameters ||
|---|---|
| `clickOrTouchEvent: MouseEvent | TouchEvent` | The browser touch or click event based on user touch and click interaction. |

*** ** * ** ***

### sendPlaybackEnd

`sendPlaybackEnd(): void` Notifies Google ad servers that playback for the given content playback session has ended. Call this method when playback ends. The following list details examples of playback ending:

- The player reaches the end of the stream.
- The user exits playback mid-way.
- The user leaves the page.
- When advancing to the next content item in a playlist setting.
This method ends the asynchronous calls to Google servers.

*** ** * ** ***

### sendPlaybackStart

`sendPlaybackStart(): void` Notifies Google ad servers that playback for the given content playback session has started. Call this method on video player start. Make this call in response to a user-initiated action, such as click-to-play or a page initiated action like autoplay.  

This method starts asynchronous calls to Google servers and collects signals needed for invalid traffic (IVT) monitoring and detection.