Topics API לאינטרנט

‫Topics API מאפשר לפרסם על סמך תחומי עניין בלי להשתמש בקובצי Cookie של צד שלישי.

How the Topics API works

The Topics API can be used to observe and provide access to topics that appear to be of interest to the user, based on their activity. The Topics API can then give API callers (such as ad tech platforms) access to a user's topics of interest, but without revealing additional information about the user's activity.

Key concepts

  • A topic is a human-readable topic of interest for the current user and is part of the Topics taxonomy.
  • A caller is an entity, such as an app, a third-party SDK, a website, or service, that makes a request to the Topics API to observe or access a user's interests.
  • A topic is observed by a caller, if the caller made a Topics API request from a web page or app associated with this topic during the past three epochs.
  • An epoch is a period of topic computation, which defaults to one week.
  • A taxonomy is a hierarchical list of categories, which includes, for example, such categories as /Arts & Entertainment/Music & Audio/Soul & R&B and /Business & Industrial/Business Services/Corporate Events.
  • Topics are derived using a classifier model that maps user activity to zero or more topics.

Topics API flow core steps

The Topics API lifecycle has three main steps:

  • Observe user activity, such as when they visit the web page https://cats.example/tabby/index.html or download the app cats.
  • Derive topics from user activity, for example /Pets & Animals/Pets/Cats.
  • Access topics previously observed for the user, for example as a signal to select relevant advertising (such as a cat food promotion).

Observe topics

Callers can only access topics of interest that they've observed. A caller observes a topic when they make a Topics API request from a context associated with this topic. To illustrate this concept, consider the following simplified example.

  • Suppose there are two Topics API callers: A and B.
  • There are two contexts:
    • Greenhouse, for example an app named Greenhouse or a website greenhouse.example, associated with the topic Home & Garden.
    • Tennis exercises, for example an app named Tennis Exercises or a website tennis.example, associated with the topic Sports/Tennis.
  • Both caller A and B are present in the context of Greenhouse.
  • Only the caller B is present in the context of Tennis exercises.
  • Assume that no topics were observed for the user before epoch 1, for the sake of simplification.
  • The user visits the Greenhouse app, and callers A and B make a Topics API call to record the user visit to the page or app (see the implementation guide suggested in Next steps to find out how to call the Topics API). This record (a hostname or app data) is later used to derive topics of interest. The Topics API will later mark the topic Home & Garden as observed by both callers A and B.
  • The user visits the Tennis exercises app. Only the caller B sends a Topics API request. The Topics API will later mark the topic Sports/Tennis as observed by the caller B.
  • By the end of the epoch, the Topics API refreshes the user's top topics and determines the callers that observed these topics based on user activity.
  • Later, when the caller B makes another Topics API call, it can get either Home & Garden or Sports/Tennis topic (or, with a 5% chance, a random topic) for this user in the response array.
  • Caller A can only access the topic Home & Garden, as it has never observed the topic Sports/Tennis. This means that a third-party will only learn about a user's topic of interest within the specific context (app or website) where it is present.
Diagram showing that the Topics API only marks the topics as observed if the callers has presence in the context.
The Topics API marks the topics observed only by the callers that have presence in the context of these topics. The callers will only be able to access the topics they have observed.

Derive topics

Topics derives topics of interest from user activity. The topics are selected from a predefined open-source taxonomy. Once per epoch, Topics refreshes the user's top five topics and the callers that observed them during the epoch. The Topics classifier model derives topics from user activity: hostname for a web page visit, app information on Android.

Caller accesses user's topics of interest

The API returns only topics that have been observed by the caller within the most recent three epochs. A maximum of three topics may be returned to a caller,one topic for each of the three recent epochs (if the caller observed topics for that epoch). The returned topics can be used by the caller to supplement any contextual information and can be combined to help find a more relevant ad for the user.

Epochs

The Topics API must ensure that the topics of interest it provides are kept up to date. The topics are inferred for a user based on their activity during a period of time known as an epoch, one week by default. Each user has their own epochs (epochs are "per user") and the initial start time is randomized.

Once each epoch, the Topics API computes the user's top five topics and determines which callers observed those topics using on-device information. The topic selected for each epoch is randomly selected from the user's top five topics for that time period. To further enhance privacy and ensure that all topics may be represented, there is a 5% chance the topic is randomly selected from all possible topics in the taxonomy of interests.

נושאים באינטרנט בפועל

באינטרנט, המערכת מסיקה את הנושאים משמות המארחים של הדפים שהמשתמש מבקר בהם. לדוגמה, הנושא שמשויך לאתר dogs.example יכול להיות /Pets & Animals/Pets/Dogs.

בתרשים הבא מוצגת דוגמה פשוטה שממחישה איך Topics API יכול לעזור לפלטפורמת טכנולוגיות פרסום לבחור מודעה מתאימה. בדוגמה הזו אנחנו מניחים שלדפדפן של המשתמש כבר יש מודל למיפוי שמות מארחים של אתרים לנושאים.

תרשים שמציג את השלבים במחזור החיים של Topics API, החל מביקור של משתמש באתרים ועד להצגת מודעה.
בתרשים של מחזור החיים של Topics API מוסבר על השלבים של פעולות ה-API מנקודת מבט כללית.

הדפדפן קובע את המקור של המתקשר מההקשר של הקוד שמפעיל את Topics API. בפועל, המשמעות היא שמשתמשי Topics שולחים קריאה ל-API ב-iframe מהמקור שלהם, או שהם כוללים נושאים בבקשת אחזור למקור שלהם.

לדוגמה, אפשר להטמיע פלטפורמה לספקים (SSP) בכמה אתרים של בעלי תוכן דיגיטלי. לאחר מכן, פלטפורמת ה-SSP יכולה לשלוח קריאה ל-Topics API בתוך iframe מהמקור שלה, וכך לבחון נושאים שמשויכים למשתמש באתרים האלה. את הנושאים האלה אפשר לשתף עם פלטפורמה למפרסמים (DSP) כדי לעזור לה לבחור מודעה רלוונטית למשתמש.

איך ה-API מחליט אילו נושאים יוצגו למשתמשים שקוראים לו

הנושאים שמוחזרים למי שקורא ל-API הם רק נושאים שהמערכת זיהתה לאחרונה, והנושאים שמשויכים למשתמש מתעדכנים פעם אחת בכל תקופה: פרק זמן שמוגדר כשבוע בהטמעה של Chrome. כלומר, ה-API מספק חלון זמן מתגלגל שבו גורם קורא נתון יכול לקבל נושאים שנצפו.

בטבלה הבאה מופיעה דוגמה (קטנה באופן לא מציאותי) של היסטוריית גלישה היפותטית של משתמש במהלך תקופה אחת, שבה מוצגים נושאים שמשויכים לאתרים שהוא ביקר בהם, והגורמים שקוראים ל-API שקיימים בכל אתר (הישויות שקוראות ל-document.browsingTopics() בקוד JavaScript שכלול באתר).

אתר נושאים קריאות ל-API באתר
running.example Running & Walking
Athletic Shoes
adtech1.example
adtech2.example
dogs.example Dogs adtech1.example
holiday.example Hotels & Accommodations adtech2.example
sunglasses.example Sunglasses [none]

בסוף התקופה (שבוע כברירת מחדל), Topics API יוצר את הנושאים המובילים בדפדפן לאותו שבוע.

  • הדומיין adtech1.example עומד עכשיו בדרישות לקבלת הנושאים Running & Walking, ‏ Athletic Shoes ו-Dogs, כי הוא זיהה אותם בדומיין running.example וגם בדומיין dogs.example.
  • הדומיין adtech1.example לא עומד בדרישות לקבלת הנושא Hotels & Accommodations עבור המשתמש הזה, כי הוא לא מופיע באף אחד מהאתרים שהמשתמש ביקר בהם לאחרונה שמשויכים לנושא הזה.
  • הנושאים Running & Walking, Athletic Shoes ו-Hotels & Accommodations נצפו ב-adtech2.example, אבל הנושא Dogs לא נצפה בו.

המשתמש ביקר באתר sunglasses.example, שמוגדר בו הנושא Sunglasses, אבל לא בוצעו קריאות ל-Topics API באתר הזה. בשלב הזה, המשמעות היא שהנושא Sunglasses לא יוחזר על ידי ה-API לכל מתקשר.

בשבוע השני, המשתמש מבקר באתר אחר:

אתר נושאים קריאות ל-API באתר
cameras.example Camera & Photo Equipment adtech2.example

בנוסף, קוד מ-adtech2.example מתווסף אל sunglasses.example:

אתר נושאים קריאות ל-API באתר
sunglasses.example Sunglasses adtech2.example

בנוסף ל-Running & Walking, ל-Athletic Shoes ול-Hotels & Accommodations משבוע 1, המשמעות היא שעכשיו adtech2.example יוכל לקבל את הנושאים Camera & Photo Equipment ו-Sunglasses – אבל רק באפוקה הבאה, שבוע 3. כך מוודאים שצדדים שלישיים לא יוכלו ללמוד על העבר של משתמש (במקרה הזה, התעניינות באופנה) יותר ממה שהם יכולים ללמוד באמצעות קובצי Cookie.

אחרי שבועיים נוספים, יכול להיות שהנושאים Running & Walking, Athletic Shoes ו-Hotels & Accommodations יוסרו מרשימת הנושאים שעומדים בדרישות של adtech2.example אם המשתמש לא יבקר באתרים עם הנושאים האלה שכוללים קוד מ-adtech2.example.

השלבים שמתבצעים ב-Topics API כשמשתמשים מבקרים באתרים שמשתמשים ב-API.
איך ה-API מזהה נושאים וניגש אליהם.

מודל מסווג

השיטה 'נושאים' משתמשת במודל סיווג שממפה שמות מארחים של אתרים לאפס נושאים או יותר (ניתוח של מידע נוסף, כמו כתובות URL מלאות או תוכן דף, עשוי לאפשר הצגת מודעות רלוונטיות יותר, אבל גם עלול לפגוע בפרטיות).

טקסונומיה

הנושאים נבחרים מתוך טקסונומיה. הנושאים האלה נבחרו בקפידה על ידי Chrome, במטרה שהטקסונומיה תהפוך למשאב שמתוחזק על ידי תורמים מהימנים בסביבה העסקית. הטקסונומיה צריכה להיות קטנה מספיק כדי שדפדפנים של משתמשים רבים ישויכו לכל נושא. המטרה הסופית היא שהטקסונומיה תתבסס על מקור חיצוני שישלב משוב ורעיונות מכל הענף.

כדי להימנע מקטגוריות רגישות, הנושאים צריכים להיות גלויים לכולם, להתווסף על ידי אנשים ולהישאר עדכניים. הטקסונומיה שבה נעשה שימוש ב-Chrome נוצרה על ידי אנשים כדי להחריג קטגוריות שנחשבות בדרך כלל רגישות, כמו מוצא אתני או נטייה מינית.

סיווג נושאים

הנושאים נבחרים באופן ידני מתוך 50,000 האתרים המובילים, והרשימה הזו של שמות מארחים ונושאים משמשת לאימון מודל הסיווג. באתרים המובילים, הגישה לנושאים היא דרך רשימת הביטול ולא באמצעות מודל הסיווג. אתם יכולים לראות את רשימת ההחרגות באופן מקומי במחשב.

הדף chrome://topics-internals עם החלונית Classifier (מסווג) שנבחרה.
בחלונית Classifier בדף chrome://topics-internals מפורטים גרסת המודל, הנתיב שלו והנושאים שמשויכים לכל מארח שמופיע ברשימה.

הטמעה של Topics API ב-Chrome מורידה קובץ TensorFlow Lite שמייצג את המודל, כדי שאפשר יהיה להשתמש בו באופן מקומי במכשיר של המשתמש.

איך נבחרים חמשת הנושאים המובילים של המשתמש

ה-API מחזיר נושא אחד לכל תקופה, עד למקסימום של שלושה נושאים. אם מוחזרים שלושה נושאים, הם כוללים את הנושאים של התקופה הנוכחית ושתי התקופות הקודמות.

  1. בסוף כל תקופה, הדפדפן מרכיב רשימה של דפים שעומדים בקריטריונים הבאים:
    • המשתמש ביקר בדף במהלך התקופה.
    • הדף כולל קוד שקורא ל-document.browsingTopics().
    • ממשק ה-API הופעל (לדוגמה, הוא לא נחסם על ידי המשתמש או על ידי כותרת תגובה).
  2. הדפדפן, במכשיר של המשתמש, משתמש במודל המסווג שמסופק על ידי Topics API כדי למפות את שם המארח של כל דף לרשימת נושאים.
  3. הדפדפן יוצר רשימה של חמשת הנושאים המובילים.

    • כל אחד מ-22 נושאי הבסיס בטקסונומיה משויך למאגר מסוג 'שימושיות גבוהה' או 'שימושיות רגילה', על סמך משוב ממערכת האקולוגית של הפרסום. הדפדפן ממיין קודם את הנושאים לפי ההקצאה שלהם לקטגוריות. כל נושאי הצאצא יורשים את הקצאה של הדלי של נושא השורש ההורה שלהם. נושאים עם 'שימושיות גבוהה' מקבלים עדיפות.
    • לאחר מכן, הדפדפן ממיין את הנושאים לפי התדירות בכל קטגוריה.
    • חמשת הנושאים המובילים מתוך הרשימה הממוינת הזו נבחרים כנושאים המובילים של המשתמש באותה תקופה.

השיטה document.browsingTopics() מחזירה נושא אקראי מתוך חמשת הנושאים המובילים לכל תקופת זמן לקביעת נושאים, עם סיכוי של 5% שכל אחד מהנושאים האלה ייבחר באופן אקראי מתוך הטקסונומיה המלאה של הנושאים. ב-Chrome, המשתמשים יכולים גם להסיר נושאים ספציפיים או לנקות את היסטוריית הגלישה שלהם כדי לצמצם את מספר הנושאים שמוחזרים על ידי ה-API. המשתמשים יכולים גם לבטל את ההסכמה לשימוש ב-API.

בדף chrome://topics-internals אפשר לראות מידע על נושאים שנצפו במהלך התקופה הנוכחית.

Next steps

Get your environment ready to test and develop web applications with the Topics API.
Check out implementation details and code samples for callers to observe and access topics.

ראה גם

כדאי לעיין במקורות המידע שלנו כדי להבין טוב יותר את Topics API באינטרנט.