Class: NonceManager

  • The Programmatic Access Libraries automatically collect data like IP address, user interactions, diagnostics, and device identifiers for advertising and analytics.

  • This data is shared for purposes of advertising, analytics, and fraud prevention and is encrypted during transmission using TLS protocol.

  • App developers can control the collection of Android advertising IDs and explore features like Limited Ads for data management.

  • Developers are responsible for disclosing data collection and usage practices in the Google Play Data safety section based on their app's specific implementation and features used.

  • This page focuses on the latest version of the Programmatic Access Libraries; developers should update to the latest version and review this page regularly to ensure accurate disclosures.

Methods

getNonce

public

getNonce() returns string

Returns

string The nonce generated for this manager when it was loaded. This value will never change for a given NonceManager instance. This nonce value is only valid for a single content playback session up to a maximum duration of 6 hours.

sendAdClick

public

sendAdClick() returns void

Notifies Google ad servers that a clickthrough on an ad has occurred during the given content playback session.

Returns

void 

sendAdImpression

public

sendAdImpression() returns void

Should be called when the first frame of the ad that was requested with the nonce generated by this manager is displayed.

Deprecated
Use `sendPlaybackStart` and `sendPlaybackEnd` instead.
Returns

void 

sendAdTouch

public

sendAdTouch(clickOrTouchEvent) returns void

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

Parameter

clickOrTouchEvent

(non-null MouseEvent or non-null TouchEvent)

The browser touch or click event that was fired for the user interaction.

Returns

void 

sendPlaybackEnd

public

sendPlaybackEnd() returns void

Notifies Google ad servers that playback for the given content playback session has ended. This should be called when playback ends (for example, when the player reaches end of stream, or when the user exits playback mid-way, or 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 in sendPlaybackStart.

Returns

void 

sendPlaybackStart

public

sendPlaybackStart() returns void

Notifies Google ad servers that playback for the given content playback session has started. This should be called on "video player start". This may be in response to a user-initiated action (click-to-play) or a page initiated action (autoplay).

This method will start asynchronous calls to Google servers to collect signals needed for IVT monitoring and detection.

Returns

void