단일 콘텐츠 재생 세션의 nonce 및 이벤트 보고를 관리합니다.
프로그래매틱 수익 창출을 사용 설정하려면 각각의 이벤트가 발생하므로 sendAdClick, sendAdTouch, sendPlaybackStart, sendPlaybackEnd 등의 콘텐츠 재생 세션 수명 주기 메서드를 호출해야 합니다.
방법
getNonce
공개
getNonce()는 문자열을 반환합니다.
반환 값
string 로드 시 이 관리자에 대해 생성된 nonce입니다.
이 값은 지정된 NonceManager 인스턴스에서 절대 변경되지 않습니다. 이 nonce 값은 최대 6시간의 단일 콘텐츠 재생 세션에만 유효합니다.
sendAdClick
공개
SendAdClick()이 void를 반환함
특정 콘텐츠 재생 세션 동안 광고 클릭연결이 발생했음을
Google 광고 서버에 알립니다.
반환 값
void
sendAdImpression
공개
sendAdImpression()은 void를 반환합니다.
이 관리자가 생성한 nonce로 요청된 광고의 첫 번째 프레임이 표시될 때 호출해야 합니다.
지원 중단됨
대신 `sendPlaybackStart` 및 `sendPlaybackEnd` 를 사용합니다.
반환 값
void
sendAdTouch
공개
sendAdTouch(clickOrTouchEvent)가 void를 반환함
특정 콘텐츠 재생 세션 동안 클릭연결이 아닌
광고 터치나 클릭 (예: 건너뛰기, 음소거, 탭 등)이 발생했음을
Google 광고 서버에 알립니다.
매개변수
clickOrTouchEvent
(null이 아닌 MouseEvent 또는 null이 아닌 TouchEvent)
사용자 상호작용에서 실행된 브라우저 터치 또는 클릭 이벤트입니다.
반환 값
void
sendPlaybackEnd
공개
sendPlaybackEnd()가 void를 반환함
Google 광고 서버에 지정된 콘텐츠 재생 세션의 재생이 종료되었음을 알립니다. 재생이 종료될 때 호출되어야 합니다 (예: 플레이어가 스트림의 끝에 도달하거나 사용자가 중간에 재생을 종료할 때, 사용자가 페이지를 떠날 때 또는 재생목록 설정의 다음 콘텐츠 항목으로 이동할 때).
이 메서드는 sendPlaybackStart에서 시작된 Google 서버에 대한 비동기 호출을 종료합니다.
반환 값
void
sendPlaybackStart
공개
sendPlaybackStart()가 void를 반환함
지정된 콘텐츠 재생 세션의 재생이 시작되었음을 Google 광고 서버에 알립니다. '동영상 플레이어 시작' 시 호출해야 합니다. 이는 사용자가 시작한 작업 (클릭하여 재생) 또는 페이지에서 시작한 작업 (자동재생)에 대한 응답일 수 있습니다.
이 메서드는 IVT 모니터링 및 감지에 필요한 신호를 수집하기 위해 Google 서버에 대한 비동기 호출을 시작합니다.
[null,null,["최종 업데이트: 2025-08-21(UTC)"],[[["\u003cp\u003eThe Programmatic Access Libraries automatically collect data like IP address, user interactions, diagnostics, and device identifiers for advertising and analytics.\u003c/p\u003e\n"],["\u003cp\u003eThis data is shared for purposes of advertising, analytics, and fraud prevention and is encrypted during transmission using TLS protocol.\u003c/p\u003e\n"],["\u003cp\u003eApp developers can control the collection of Android advertising IDs and explore features like Limited Ads for data management.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers 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.\u003c/p\u003e\n"],["\u003cp\u003eThis 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.\u003c/p\u003e\n"]]],[],null,["# Class: NonceManager\n\nNonceManager\n============\n\nclass public\n\nManages a nonce and its event reporting for a single content playback\nsession.\nThe content playback session lifecycle methods, including `sendAdClick`,\n`sendAdTouch`, `sendPlaybackStart`, and `sendPlaybackEnd` must be called as\nthese respective events occur in order to enable programmatic monetization.\n\nMethods\n-------\n\n### getNonce\n\npublic\n\ngetNonce() returns string\n\nReturns\n\n: `string` The nonce generated for this manager when it was loaded.\n This value will never change for a given `NonceManager` instance. This\n nonce value is only valid for a single content playback session up to a\n maximum duration of 6 hours.\n\n### sendAdClick\n\npublic\n\nsendAdClick() returns void\n\nNotifies Google ad servers that a clickthrough on an ad has occurred during\nthe given content playback session.\n\nReturns\n\n: `void`\n\n### sendAdImpression\n\npublic\n\nsendAdImpression() returns void\n\nShould be called when the first frame of the ad that was requested with\nthe nonce generated by this manager is displayed.\n\nDeprecated\n: Use \\`sendPlaybackStart\\` and \\`sendPlaybackEnd\\` instead.\n\nReturns\n\n: `void`\n\n### sendAdTouch\n\npublic\n\nsendAdTouch(clickOrTouchEvent) returns void\n\nNotifies Google ad servers that a user touch or click on the ad other than\na clickthrough (for example, skip, mute, tap, and more.) has occurred\nduring the given content playback session.\n\n| #### Parameter ||\n|-------------------|------------------------------------------------------------------------------------------------------------------------|\n| clickOrTouchEvent | (non-null MouseEvent or non-null TouchEvent) The browser touch or click event that was fired for the user interaction. |\n\nReturns\n\n: `void`\n\n### sendPlaybackEnd\n\npublic\n\nsendPlaybackEnd() returns void\n\nNotifies Google ad servers that playback for the given content playback\nsession has ended. This should be called when playback ends (for example,\nwhen the player reaches end of stream, or when the user exits playback\nmid-way, or when the user leaves the page, or when advancing to the next\ncontent item in a playlist setting).\n\nThis method ends the asynchronous calls to Google servers started in\n`sendPlaybackStart`.\n\nReturns\n\n: `void`\n\n### sendPlaybackStart\n\npublic\n\nsendPlaybackStart() returns void\n\nNotifies Google ad servers that playback for the given content playback\nsession has started. This should be called on \"video player start\". This\nmay be in response to a user-initiated action (click-to-play) or a page\ninitiated action (autoplay).\n\nThis method will start asynchronous calls to Google servers to collect\nsignals needed for IVT monitoring and detection.\n\nReturns\n\n: `void`"]]