קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
NonceLoader
classpublic
הספרייה לגישה פרוגרמטית מאפשרת לבעלי תוכן דיגיטלי לאסוף אותות שאפשר להשתמש בהם כדי לקבל גישה לביקוש ב-AdX.
בעלי תוכן דיגיטלי צריכים ליצור NonceLoader בטעינת הדף כדי להפחית את זמן האחזור. לכל סטרימינג (ב-DAI) או בקשה פרטנית להצגת מודעה, קוראים לפונקציות הרלוונטיות להגדרת ערכים לפי הצורך, ואז קוראים לפונקציה loadNonceManager. בעלי האתרים יכולים לקרוא לפונקציה NonceManager.getNonce() כדי לקבל את המחרוזת שצריך להוסיף לבקשות להצגת מודעות כערך של פרמטר כתובת ה-URL "&paln". בעלי האתרים צריכים לשלוח קריאות ל-NonceManager.sendAdClick() ול-NonceManager.sendAdImpression() בהתאם.
יצרן
NonceLoader
new
NonceLoader(consentSettings)
Constructor.
פרמטר
consentSettings
אופציונלי
הגדרות שקשורות לתקנות ולהסכמה.
הערך לא יכול להיות null.
שיטה
loadNonceManager
public
loadNonceManager(request) מחזירה Promise שמכילה NonceManager שאינו null
non-null Promise containing non-null NonceManager ההבטחה שתמומש ברגע ש-NonceManager עם ערך חד-פעמי מוצפן שמכיל את כל המידע שלפני הגשת הצעת המחיר יהיה זמין.
[null,null,["עדכון אחרון: 2025-08-21 (שעון UTC)."],[[["\u003cp\u003eNonceLoader is a programmatic access library that enables publishers to gather signals for AdX demand.\u003c/p\u003e\n"],["\u003cp\u003ePublishers need to create a NonceLoader upon page load and utilize its methods to generate and manage nonces for ad requests.\u003c/p\u003e\n"],["\u003cp\u003eNonceManager provides methods for retrieving the nonce, which should be included in ad requests as the "&paln" URL parameter value, and for signaling ad clicks and impressions.\u003c/p\u003e\n"]]],["Publishers use the `NonceLoader` class to gather signals for unlocking AdX demand. On page load, a `NonceLoader` is created. For each stream or ad request, setters are invoked, followed by `loadNonceManager`. This method returns a `NonceManager` that yields a string, `getNonce()`, for the \"\\&paln\" URL parameter in ad requests. Subsequently, `NonceManager.sendAdClick()` and `NonceManager.sendAdImpression()` are called as needed. `loadNonceManager` requires a non-null `NonceRequest`. The `NonceLoader` constructor requires non-null `consentSettings`.\n"],null,["# Class: NonceLoader\n\nNonceLoader\n===========\n\nclass public\n\nThe programmatic access library allows publishers to collect signals that can\nbe used to unlock AdX demand.\nPublishers should create a NonceLoader on page load in order to reduce\nlatency. For each stream (for DAI) or individual ad request, call the\nrelevant setters as needed followed by a call to loadNonceManager. Publishers\ncan then call NonceManager.getNonce() in order to get the string that should\nbe added to ad requests as the value to the \"\\&paln\" URL parameter. Publishers\nshould then call NonceManager.sendAdClick() and\nNonceManager.sendAdImpression() as appropriate.\n\nConstructor\n-----------\n\n### NonceLoader\n\nnew\nNonceLoader(consentSettings)\n\nConstructor.\n\n| #### Parameter ||\n|-----------------|-------------------------------------------------------------------------------|\n| consentSettings | Optional Settings related to regulations and consent. Value must not be null. |\n\nMethod\n------\n\n### loadNonceManager\n\npublic\n\nloadNonceManager(request) returns Promise containing non-null [NonceManager](/ad-manager/pal/cast/reference/js/NonceManager)\n\n| #### Parameter ||\n|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| request | [NonceRequest](/ad-manager/pal/cast/reference/js/NonceRequest) The request containing information about the nonce being requested. Value must not be null. |\n\nReturns\n\n: `non-null Promise containing non-null `[NonceManager](/ad-manager/pal/cast/reference/js/NonceManager) The promise that will be resolved once the NonceManager with an encrypted nonce containing all pre-bid information is available."]]