‫Topics API للويب

تتيح Topics API عرض الإعلانات المستندة إلى الاهتمامات بدون استخدام ملفات تعريف الارتباط التابعة لجهات خارجية.

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 tat 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 هو /الحيوانات الأليفة والحيوانات/الحيوانات الأليفة/الكلاب.

يعرض الرسم البياني التالي مثالاً مبسطًا يوضّح كيف يمكن أن تساعد Topics API منصّة تكنولوجيا الإعلان في اختيار إعلان مناسب. يفترض المثال أنّ متصفّح المستخدم يتضمّن نموذجًا لربط أسماء مضيفي المواقع الإلكترونية بالمواضيع.

مخطّط بياني يعرض المراحل في دورة حياة Topics API، بدءًا من مستخدم يزور المواقع الإلكترونية إلى إعلان يتم عرضه
يوضّح مخطّط Topics API البياني لدورة الحياة مراحل إجراءات واجهة برمجة التطبيقات من منظور عام.

يحدِّد المتصفّح مصدر المُتصل من سياق الرمز الذي يستدعي Topics API. من الناحية العملية، يعني ذلك أنّ مستخدمي Topics يطلبون بيانات من واجهة برمجة التطبيقات في إطار iframe من مصدرهم أو يُدرِجون مواضيع في عملية جلب إلى مصدرهم.

على سبيل المثال، يمكن تضمين منصّة جهة العرض (SSP) في مواقع إلكترونية متعددة تابعة للناشرين. يمكن بعد ذلك لمنصّة SSP طلب Topics API ضمن إطار iframe من مصدرها، ما يتيح لها مراقبة المواضيع المرتبطة بمستخدم على مواقع الناشرين هذه. ويمكن بعد ذلك مشاركة هذه المواضيع مع منصّة جهة الطلب (DSP) لمساعدتها في اختيار إعلان ذي صلة للمستخدِم.

كيفية تحديد واجهة برمجة التطبيقات للمتصلين الذين يمكنهم الاطّلاع على المواضيع

لا تتلقّى تطبيقات واجهة برمجة التطبيقات سوى المواضيع التي رصدتها مؤخرًا، ويتمّ تعديل مواضيع المستخدِم مرّة واحدة في كلّ حقبة: وهي فترة زمنية تم ضبطها على أسبوع واحد في عملية تنفيذ Chrome. وهذا يعني أنّ واجهة برمجة التطبيقات توفّر فترة زمنية متجدّدة يمكن فيها لمتصل معيّن تلقّي المواضيع التي تم رصدها.

يوضّح الجدول التالي مثالاً (على الرغم من أنّه صغير بشكل غير واقعي) لسجلّ تصفّح افتراضي لأحد المستخدِمين خلال حقبة واحدة، ويعرض المواضيع المرتبطة بالمواقع الإلكترونية التي زارها، وطلبات البيانات من واجهات برمجة التطبيقات المتوفّرة على كل موقع إلكتروني (الكيانات التي تستدعي document.browsingTopics() في رمز JavaScript المضمّن على الموقع الإلكتروني).

الموقع الإلكتروني المواضيع طلبات البيانات من واجهة برمجة التطبيقات على الموقع الإلكتروني
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 لهذا المستخدِم لأنّه غير متوفّر على أيّ من المواقع الإلكترونية التي زارها المستخدِم مؤخرًا والمرتبطة بهذا الموضوع.
  • شاهد adtech2.example مواضيع Running & Walking وAthletic Shoes وHotels & Accommodations، ولكنّه لم يرى موضوع Dogs.

زار المستخدِم sunglasses.example الذي يتضمّن الموضوع Sunglasses، ولكن لم يتمّ إجراء أيّ طلبات إلى Topics API على هذا الموقع الإلكتروني. في هذه المرحلة، يعني ذلك أنّ واجهة برمجة التطبيقات لن تعرض موضوع Sunglasses لأي متصل.

في الأسبوع الثاني، يزور المستخدِم موقعًا إلكترونيًا آخر:

الموقع الإلكتروني المواضيع طلبات البيانات من واجهة برمجة التطبيقات على الموقع الإلكتروني
cameras.example Camera & Photo Equipment adtech2.example

بالإضافة إلى ذلك، تتم إضافة رمز من adtech2.example إلى sunglasses.example:

الموقع الإلكتروني المواضيع طلبات البيانات من واجهة برمجة التطبيقات على الموقع الإلكتروني
sunglasses.example Sunglasses adtech2.example

بالإضافة إلى Running & Walking وAthletic Shoes وHotels & Accommodations من الأسبوع 1، يعني ذلك أنّ adtech2.example ستتمكّن الآن من تلقّي مواضيع Camera & Photo Equipment وSunglasses، ولكن ليس قبل الفترة التالية، أي الأسبوع 3. ويضمن ذلك عدم تمكّن الجهات الخارجية من معرفة المزيد من المعلومات عن ماضي المستخدم (في هذه الحالة، الاهتمام بالموضة) أكثر مما يمكنها فعله باستخدام ملفات تعريف الارتباط.

بعد أسبوعَين آخرين، قد يتمّ حذف Running & Walking وAthletic Shoes وHotels & Accommodations من قائمة المواضيع المؤهّلة في adtech2.example إذا لم يزور المستخدِم أيّ مواقع إلكترونية تتضمّن هذه المواضيع وتتضمن رمزًا من adtech2.example.

الخطوات التي تتّخذها Topics API عندما يزور المستخدمون المواقع الإلكترونية التي تستخدم واجهة برمجة التطبيقات
كيفية رصد واجهة برمجة التطبيقات للمواضيع والوصول إليها

نموذج المصنِّف

تستخدِم ميزة "المواضيع" نموذجًا للتصنيف يربط أسماء مضيفي المواقع الإلكترونية بمواضيع معدومة أو أكثر (قد يؤدي تحليل معلومات إضافية، مثل عناوين URL الكاملة أو محتوى الصفحة، إلى عرض إعلانات أكثر صلة، ولكن قد يؤدي أيضًا إلى تقليل الخصوصية).

التصنيف

يتم اختيار المواضيع من تصنيف. وقد نظم فريق Chrome هذه المواضيع بهدف أن يصبح التصنيف مرجعًا يُعدّه مساهمون موثوق بهم في المنظومة المتكاملة. يجب أن يكون التصنيف صغيرًا بما يكفي ليتم ربط متصفّحات العديد من المستخدِمين بكل موضوع. والهدف النهائي هو الحصول على التصنيف من جهة خارجية تدمج الملاحظات والأفكار من جميع أنحاء المجال.

لتجنّب الفئات الحسّاسة، يجب أن تكون المواضيع علنية ومنظّمة يدويًا وأن تظلّ محدّثة. تم إعداد التصنيف الذي يستخدمه Chrome من قِبل فريق بشري لاستبعاد الفئات التي يُعتبَر أنّها حسّاسة بشكل عام، مثل العِرق أو الميل الجنسي.

تصنيف المواضيع

يتم تنظيم المواضيع يدويًا لـ 50,000 من أهم المواقع الإلكترونية، ويتم استخدام قائمة الاستبدال هذه التي تم تنظيمها الخاصة بأسماء النطاقات والمواضيع لتدريب نموذج التصنيف. بالنسبة إلى أهم المواقع الإلكترونية، يتم الوصول إلى المواضيع من قائمة الاستبدال بدلاً من استخدام نموذج المصنِّف. يمكنك عرض قائمة الاستبدال على جهاز الكمبيوتر.

صفحة chrome://topics-internals مع اختيار لوحة "المصنّف"
تعرض لوحة "المصنّف" في صفحة chrome://topics-internals إصدار النموذج ومساره والمواضيع المرتبطة بكل مضيف مُدرَج.

عند استخدام Chrome لواجهة برمجة التطبيقات Topics API، يتم تنزيل ملف TensorFlow Lite يمثّل النموذج ليتمكّن المستخدم من استخدامه على جهازه.

كيفية اختيار أهم خمسة مواضيع للمستخدم

تعرض واجهة برمجة التطبيقات موضوعًا واحدًا لكل حقبة، وثلاثة مواضيع كحد أقصى. إذا تم عرض ثلاثة مواضيع، سيشمل ذلك مواضيع الحقبة الحالية والحقبتين السابقتين.

  1. في نهاية كل حقبة، يجمع المتصفّح قائمة بالصفحات التي تستوفي المعايير التالية:
    • زار المستخدم الصفحة خلال الحقبة.
    • تتضمّن الصفحة رمزًا يستدعي document.browsingTopics().
    • تم تفعيل واجهة برمجة التطبيقات (على سبيل المثال، لم يتم حظرها من قِبل المستخدم أو من خلال عنوان استجابة).
  2. يستخدم المتصفّح على جهاز المستخدم نموذج التصنيف الذي تقدّمه Topics API لربط اسم المضيف لكل صفحة بقائمة المواضيع.
    • يتمّ تصنيف كلّ موضوع من المواضيع الأساسية الـ 22 في التصنيف إلى مجموعة "ذات فائدة عالية" أو "ذات فائدة عادية" استنادًا إلى الملاحظات الواردة من المنظومة المتكاملة للإعلان. يُرتّب المتصفّح المواضيع أولاً حسب تخصيص الحزمة. ترث جميع المواضيع الفرعية تخصيص الحزمة من الموضوع الجذر الرئيسي. يتم منح الأولوية للموضوعات "ذات الاستخدام العالي".
    • بعد ذلك، يُرتِّب المتصفّح المواضيع حسب معدّل تكرارها ضمن كل مجموعة.
    • يتم اختيار أهم خمسة مواضيع من هذه القائمة المرتبطة كأهم مواضيع المستخدِم في تلك الحقبة.

بعد ذلك، تعرض طريقة document.browsingTopics() موضوعًا عشوائيًا من بين أهم خمسة مواضيع لكل حقبة، مع احتمالية بنسبة% 5 أن يتم اختيار أيّ من هذه المواضيع عشوائيًا من التصنيف الكامل للمواضيع. في Chrome، يمكن للمستخدمين أيضًا إزالة مواضيع فردية أو محو سجلّ التصفّح لتقليل عدد المواضيع التي تعرضها واجهة برمجة التطبيقات. يمكن للمستخدمين أيضًا إيقاف واجهة برمجة التطبيقات.

يمكنك الاطّلاع على معلومات عن المواضيع التي تم رصدها خلال الحقبة الحالية من صفحة 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.

See also

Check out our resources to better understand the Topics API on the Web.