קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
NonceManager
classציבורי
ניהול של צופן חד-פעמי (nonce) ואת הדיווח על אירועים עבור סשן יחיד של הפעלת תוכן.
יש להפעיל את השיטות למחזור החיים של הפעלת תוכן, כולל sendAdClick,
sendAdTouch, sendPlaybackStart ו-sendPlaybackEnd מכיוון
שהאירועים המתאימים מתרחשים כדי להפעיל מונטיזציה פרוגרמטית.
שיטות
getNonce
ציבורי
getNonce() מוחזרת מחרוזת
החזרות
string החד-פעמי (nonce) שנוצר לחשבון הניהול הזה בזמן הטעינה.
הערך הזה אף פעם לא ישתנה במופע נתון של NonceManager. הערך חד-פעמי (nonce) תקף רק בסשן יחיד של הפעלת תוכן, עד למשך עד 6 שעות לכל היותר.
sendAdClick
ציבורי
sendAdClick() returns void
מודיע לשרתי המודעות של Google שהתרחש קליק על מודעה במהלך הסשן הנתון של הפעלת התוכן.
החזרות
void
sendAdImpression
ציבורי
sendAdimpression() מוחזרת void
יש להפעיל את הקריאה כאשר מוצגת המסגרת הראשונה של המודעה שהתבקשה עם
ה-nonce שנוצרה על ידי המנהל הזה.
הוצא משימוש
במקום זאת, צריך להשתמש ב-'sendPlaybackStart' וב-'sendPlaybackEnd'.
החזרות
void
sendAdTouch
ציבורי
sendAdTouch(clickOrTouchEvent) returns void
מודיע לשרתי המודעות של Google שמשתמש מסוים נגע במודעה או לוחץ עליה, שלא בוצע קליק (לדוגמה, דילוג, השתקה, הקשה וכו') במהלך הסשן הנתון של הפעלת התוכן.
פרמטר
clickOrTouchEvent
(non-null MouseEvent או non-null TouchEvent)
אירוע המגע או הלחיצה בדפדפן שהופעל
במסגרת האינטראקציה של המשתמש.
החזרות
void
sendPlaybackEnd
ציבורי
sendActivateEnd() החזרת void
מודיעה לשרתי המודעות של Google שההפעלה של סשן הפעלת התוכן
הסתיימה. צריך לקרוא להקראה כשההפעלה מסתיימת (לדוגמה, כשהנגן מגיע לסוף הסטרימינג, או כשהמשתמש יוצא מההפעלה באמצע, כשהמשתמש עוזב את הדף או כשהוא מתקדם לפריט התוכן הבא בהגדרת פלייליסט).
השיטה הזו מסיימת את הקריאות האסינכרוניות לשרתים של Google שהתחילו ב-sendPlaybackStart.
החזרות
void
sendPlaybackStart
ציבורי
sendplayStart() חוזרות ביטול
מודיעה לשרתי המודעות של Google שההפעלה בסשן הנתון של הפעלת התוכן
התחילה. יש לקרוא לתכונה זו ב'התחלת נגן וידאו'. זה
יכול להיות בתגובה לפעולה ביוזמת המשתמש (לחיצה להפעלה) או לפעולה
המופעלת על ידי דף (הפעלה אוטומטית).
השיטה הזו תפעיל קריאות אסינכרוניות לשרתים של Google כדי לאסוף
אותות שדרושים לצורך מעקב וזיהוי של IVT.
[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`"]]