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

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

| Methods ||
|---|---|
| `https://developers.google.com/ad-manager/pal/cast/reference/interface/goog.cast.pal.NonceManager#goog.cast.pal.NonceManager.getNonce` |   |
| `https://developers.google.com/ad-manager/pal/cast/reference/interface/goog.cast.pal.NonceManager#goog.cast.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/cast/reference/interface/goog.cast.pal.NonceManager#goog.cast.pal.NonceManager.sendAdImpression` | **Deprecated.**Notifies Google ad servers that the first frame of the ad is displayed. |
| `https://developers.google.com/ad-manager/pal/cast/reference/interface/goog.cast.pal.NonceManager#goog.cast.pal.NonceManager.sendAdTouch` | Notifies Google ad servers that a user touch or click on the ad other than a clickthrough, for example, skip, mute, and tap, has occurred during the given content playback session. |
| `https://developers.google.com/ad-manager/pal/cast/reference/interface/goog.cast.pal.NonceManager#goog.cast.pal.NonceManager.sendPlaybackEnd` | Notifies Google ad servers that playback for the given content playback session has ended. |
| `https://developers.google.com/ad-manager/pal/cast/reference/interface/goog.cast.pal.NonceManager#goog.cast.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 when the `NonceLoader` instance is loaded. 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 duration of six hours. |

*** ** * ** ***

### 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 the first frame of the ad is displayed. The ad is the one requested using the nonce that this `NonceManager` instance generates.

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

*** ** * ** ***

### sendAdTouch

`sendAdTouch(userInteractionEvent: Event): void` Notifies Google ad servers that a user touch or click on the ad other than a clickthrough, for example, skip, mute, and tap, has occurred during the given content playback session.

| Parameters ||
|---|---|
| `userInteractionEvent: Event` | The user interaction event the Cast framework emits. |

*** ** * ** ***

### sendPlaybackEnd

`sendPlaybackEnd(): void` Notifies Google ad servers that playback for the given content playback session has ended. Call this method when playback ends. For example, when the player reaches the end of the stream, when the user exits playback mid way, when the user leaves the page, or when advancing to the next content item in a playlist setting.  

This method ends the asynchronous calls to Google servers started when calling the `sendPlaybackStart` method.

*** ** * ** ***

### 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 to collect signals needed for invalid traffic (IVT) monitoring and detection.