Topics API untuk Web

Topics API memungkinkan iklan berbasis minat, tanpa menggunakan cookie pihak ketiga.

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.

Penerapan Topik di Web

Di web, topik disimpulkan dari nama host halaman yang dikunjungi pengguna. Misalnya, topik yang disimpulkan untuk situs dogs.example mungkin adalah /Hewan Peliharaan & Binatang/Hewan Peliharaan/.

Diagram berikut menunjukkan contoh sederhana untuk menunjukkan cara Topics API dapat membantu platform teknologi iklan memilih iklan yang sesuai. Contoh ini mengasumsikan bahwa browser pengguna sudah memiliki model untuk memetakan nama host situs ke topik.

Diagram yang menunjukkan tahapan dalam siklus proses Topics API, mulai dari pengguna yang mengunjungi situs hingga iklan ditampilkan.
Diagram siklus proses Topics API menjelaskan tahapan tindakan API dari sudut pandang tingkat tinggi.

Browser menentukan asal pemanggil dari konteks kode yang memanggil Topics API. Dalam praktiknya, ini berarti pengguna Topics memanggil API dalam iframe dari asalnya atau menyertakan topik dalam pengambilan ke asalnya.

Misalnya, platform sisi suplai (SSP) dapat disematkan di beberapa situs penayang. SSP kemudian dapat memanggil Topics API dalam iframe dari asalnya, sehingga dapat mengamati topik yang terkait dengan pengguna di situs penayang tersebut. Topik ini kemudian dapat dibagikan ke platform sisi permintaan (DSP) untuk membantunya memilih iklan yang relevan bagi pengguna.

Cara API menentukan pemanggil yang melihat topik tertentu

Pemanggil API hanya menerima topik yang baru-baru ini mereka amati, dan topik untuk pengguna diperbarui sekali setiap epoch: periode waktu, yang ditetapkan ke satu minggu dalam penerapan Chrome. Artinya, API menyediakan periode berjalan tempat pemanggil tertentu dapat menerima topik yang diamati.

Tabel berikut menguraikan contoh (meskipun kecil secara tidak realistis) histori penjelajahan hipotetis untuk pengguna selama satu epoch, yang menampilkan topik yang terkait dengan situs yang telah mereka kunjungi, dan pemanggil API yang ada di setiap situs (entity yang memanggil document.browsingTopics() dalam kode JavaScript yang disertakan di situs).

Situs Topik Pemanggil API di situs
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]

Pada akhir epoch (secara default satu minggu), Topics API akan menghasilkan topik teratas browser untuk minggu tersebut.

  • adtech1.example kini memenuhi syarat untuk menerima topik Running & Walking, Athletic Shoes, dan Dogs, karena topik tersebut diamati di running.example dan juga di dogs.example.
  • adtech1.example tidak memenuhi syarat untuk menerima topik Hotels & Accommodations bagi pengguna ini karena tidak ada di situs mana pun yang baru-baru ini dikunjungi pengguna dan dikaitkan dengan topik tersebut.
  • adtech2.example telah melihat topik Running & Walking, Athletic Shoes, dan Hotels & Accommodations, tetapi belum melihat topik Dogs.

Pengguna mengunjungi sunglasses.example, yang memiliki topik Sunglasses, tetapi tidak ada panggilan ke Topics API di situs tersebut. Pada tahap ini, artinya topik Sunglasses tidak akan ditampilkan oleh API untuk pemanggil apa pun.

Pada minggu kedua, pengguna mengunjungi situs lain:

Situs Topik Pemanggil API di situs
cameras.example Camera & Photo Equipment adtech2.example

Selain itu, kode dari adtech2.example ditambahkan ke sunglasses.example:

Situs Topik Pemanggil API di situs
sunglasses.example Sunglasses adtech2.example

Selain Running & Walking, Athletic Shoes, dan Hotels & Accommodations dari minggu ke-1, hal ini berarti adtech2.example kini dapat menerima topik Camera & Photo Equipment dan Sunglasses — tetapi tidak sampai epoch berikutnya, minggu ke-3. Hal ini memastikan bahwa pihak ketiga tidak dapat mempelajari lebih lanjut masa lalu pengguna (dalam hal ini, minat pada mode) daripada yang dapat mereka lakukan dengan cookie.

Setelah dua minggu lagi, Running & Walking, Athletic Shoes, dan Hotels & Accommodations dapat dihapus dari daftar topik yang memenuhi syarat adtech2.example jika pengguna tidak mengunjungi situs apa pun dengan topik tersebut yang menyertakan kode dari adtech2.example.

Langkah-langkah yang dilakukan Topics API saat pengguna mengunjungi situs yang menggunakan API.
Cara API mengamati dan mengakses topik.

Model pengklasifikasi

Topics menggunakan model pengklasifikasi yang memetakan nama host situs ke nol atau beberapa topik (menganalisis informasi tambahan, seperti URL lengkap atau konten halaman, dapat memungkinkan iklan yang lebih relevan, tetapi juga dapat mengurangi privasi).

Taksonomi

Topik dipilih dari taksonomi. Topik ini telah diseleksi oleh Chrome, dengan tujuan agar taksonomi menjadi referensi yang dikelola oleh kontributor ekosistem tepercaya. Taksonomi harus cukup kecil sehingga banyak browser pengguna akan dikaitkan dengan setiap topik. Tujuan akhirnya adalah agar taksonomi ini bersumber dari pihak eksternal yang menggabungkan masukan dan ide dari seluruh industri.

Untuk menghindari kategori sensitif, topik harus bersifat publik, diseleksi oleh manusia, dan tetap diperbarui. Taksonomi yang digunakan oleh Chrome telah diseleksi oleh manusia untuk mengecualikan kategori yang umumnya dianggap sensitif, seperti etnis atau orientasi seksual.

Klasifikasi topik

Topik diseleksi secara manual untuk 50.000 situs teratas, dan daftar penggantian nama host dan topik yang diseleksi ini digunakan untuk melatih model pengklasifikasi. Untuk situs teratas, topik diakses dari daftar penggantian, bukan dengan menggunakan model pengklasifikasi. Anda dapat melihat daftar penggantian secara lokal di komputer.

Halaman chrome://topics-internals dengan panel Pengklasifikasi dipilih.
Panel Pengklasifikasi halaman chrome://topics-internals mencantumkan versi model, jalurnya, dan topik yang terkait dengan setiap host yang tercantum.

Implementasi Topics API Chrome mendownload file TensorFlow Lite yang mewakili model sehingga dapat digunakan secara lokal di perangkat pengguna.

Cara lima topik teratas pengguna dipilih

API menampilkan satu topik untuk setiap epoch, hingga maksimum tiga. Jika tiga ditampilkan, ini mencakup topik untuk epoch saat ini dan dua sebelumnya.

  1. Di akhir setiap epoch, browser akan mengompilasi daftar halaman yang memenuhi kriteria berikut:
    • Halaman dikunjungi oleh pengguna selama epoch.
    • Halaman menyertakan kode yang memanggil document.browsingTopics().
    • API diaktifkan (misalnya, tidak diblokir oleh pengguna atau oleh header respons).
  2. Browser, di perangkat pengguna, menggunakan model pengklasifikasi yang disediakan oleh Topics API untuk memetakan nama host untuk setiap halaman ke daftar topik.
  3. Browser akan membuat daftar lima topik teratas.

    • Setiap dari 22 topik root dalam taksonomi ditetapkan ke bucket "utilitas tinggi" atau "utilitas standar" berdasarkan masukan dari ekosistem periklanan. Browser pertama-tama mengurutkan topik berdasarkan penetapan bucket-nya. Semua topik turunan mewarisi penetapan bucket dari topik root induknya. Topik "Kegunaan tinggi" diprioritaskan.
    • Kemudian, browser akan mengurutkan topik berdasarkan frekuensi dalam setiap bucket.
    • Lima topik teratas dari daftar yang diurutkan ini dipilih sebagai topik teratas pengguna untuk epoch tersebut.

Metode document.browsingTopics() kemudian menampilkan topik acak dari lima teratas untuk setiap epoch, dengan peluang 5% bahwa salah satu dari topik tersebut dapat dipilih secara acak dari taksonomi topik lengkap. Di Chrome, pengguna juga dapat menghapus topik satu per satu, atau menghapus histori penjelajahan mereka untuk mengurangi jumlah topik yang ditampilkan oleh API. Pengguna juga dapat memilih tidak ikut API.

Anda dapat melihat informasi tentang topik yang diamati selama epoch saat ini dari halaman 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.

Lihat juga

Lihat referensi kami untuk lebih memahami Topics API di Web.