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 appcats
. - 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
.
- Greenhouse, for example an app named Greenhouse or a website greenhouse.example, associated with the topic
- 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
orSports/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 topicSports/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.

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 ใน iframe จากต้นทาง หรือรวมหัวข้อไว้ในการดึงข้อมูลไปยังต้นทาง
เช่น แพลตฟอร์มฝั่งขาย (SSP) สามารถฝังในเว็บไซต์ของผู้เผยแพร่โฆษณาได้หลายแห่ง จากนั้น SSP จะเรียกใช้ Topics API ภายใน iframe จากต้นทาง ซึ่งจะช่วยให้สามารถสังเกตหัวข้อที่เชื่อมโยงกับผู้ใช้ในเว็บไซต์ของผู้เผยแพร่โฆษณาเหล่านั้นได้ จากนั้นระบบจะแชร์หัวข้อเหล่านี้กับแพลตฟอร์มฝั่งดีมานด์ (DSP) เพื่อช่วยเลือกโฆษณาที่เกี่ยวข้องสําหรับผู้ใช้
วิธีที่ API ตัดสินใจว่าผู้เรียกจะให้แสดงหัวข้อใด
ผู้เรียก API จะได้รับเฉพาะหัวข้อที่เพิ่งสังเกตเห็น และระบบจะรีเฟรชหัวข้อของผู้ใช้ทุกๆ Epoch 1 ครั้ง ซึ่งเป็นระยะเวลาที่กำหนดไว้ที่ 1 สัปดาห์ในการใช้งานของ 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] |
เมื่อสิ้นสุดช่วงเวลา (โดยค่าเริ่มต้นคือ 1 สัปดาห์) 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 ในเว็บไซต์นั้น ขั้นตอนนี้หมายความว่า API จะไม่แสดงหัวข้อ Sunglasses
แก่ผู้เรียก API รายใดก็ตาม
ในสัปดาห์ที่ 2 ผู้ใช้เข้าชมเว็บไซต์อื่น
ไซต์ | หัวข้อ | ผู้เรียก 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 วิธีนี้ช่วยให้มั่นใจได้ว่าบุคคลที่สามจะไม่สามารถเรียนรู้เพิ่มเติมเกี่ยวกับอดีตของผู้ใช้ (ในกรณีนี้คือความสนใจเรื่องแฟชั่น) ได้มากกว่าการใช้คุกกี้
หลังจากผ่านไป 2 สัปดาห์ Running & Walking
, Athletic Shoes
และ Hotels & Accommodations
อาจออกจากรายการหัวข้อที่มีสิทธิ์ของ adtech2.example หากผู้ใช้ไม่ได้เข้าชมเว็บไซต์ที่มีหัวข้อเหล่านั้นซึ่งมีโค้ดจาก adtech2.example

โมเดลตัวแยกประเภท
Topics ใช้โมเดลการจัดประเภทซึ่งแมปชื่อโฮสต์ของเว็บไซต์กับหัวข้อตั้งแต่ 0 หัวข้อขึ้นไป (การวิเคราะห์ข้อมูลเพิ่มเติม เช่น URL แบบเต็มหรือเนื้อหาหน้าเว็บ อาจช่วยให้แสดงโฆษณาที่มีความเกี่ยวข้องมากขึ้น แต่ก็อาจลดความเป็นส่วนตัวด้วย)
การจัดหมวดหมู่
เลือกหัวข้อจากการจัดหมวดหมู่ หัวข้อเหล่านี้ได้รับการดูแลจัดการโดย Chrome โดยมีเป้าหมายเพื่อทำให้การจัดหมวดหมู่กลายเป็นแหล่งข้อมูลที่ดูแลรักษาโดยผู้มีส่วนร่วมในระบบนิเวศที่เชื่อถือได้ การจัดหมวดหมู่ต้องเล็กพอที่จะเชื่อมโยงเบราว์เซอร์ของผู้ใช้จำนวนมากกับแต่ละหัวข้อ เป้าหมายสุดท้ายคือการจัดหมวดหมู่มาจากบุคคลภายนอกที่รวมความคิดเห็นและแนวคิดจากทั่วทั้งอุตสาหกรรม
หัวข้อต้องเป็นแบบสาธารณะ ดูแลจัดการโดยเจ้าหน้าที่ และอัปเดตอยู่เสมอเพื่อหลีกเลี่ยงหมวดหมู่ที่ละเอียดอ่อน การจัดหมวดหมู่ที่ Chrome ใช้ได้รับการดูแลจัดการโดยมนุษย์เพื่อยกเว้นหมวดหมู่ที่โดยทั่วไปถือว่ามีความละเอียดอ่อน เช่น ชาติพันธุ์หรือรสนิยมทางเพศ
การจัดประเภทหัวข้อ
หัวข้อได้รับการดูแลจัดการโดยเจ้าหน้าที่สำหรับเว็บไซต์ยอดนิยม 50,000 รายการ และระบบจะใช้รายการชื่อโฮสต์และหัวข้อที่ดูแลจัดการนี้เพื่อฝึกโมเดลการจัดประเภท สําหรับเว็บไซต์ยอดนิยม ระบบจะเข้าถึงหัวข้อจากรายการการลบล้างแทนที่จะใช้โมเดลตัวแยกประเภท คุณสามารถดูรายการการลบล้างในเครื่องคอมพิวเตอร์ได้

chrome://topics-internals
จะแสดงเวอร์ชันโมเดล เส้นทาง และหัวข้อที่เชื่อมโยงกับโฮสต์แต่ละรายการที่แสดงการใช้งาน Topics API ของ Chrome จะดาวน์โหลดไฟล์ TensorFlow Lite ที่แสดงโมเดลเพื่อให้ใช้โมเดลในเครื่องของผู้ใช้ได้
วิธีเลือก 5 หัวข้อยอดนิยมของผู้ใช้
API จะแสดงผลหัวข้อ 1 หัวข้อต่อแต่ละ Epoch โดยสูงสุดไม่เกิน 3 หัวข้อ หากระบบแสดงผล 3 รายการ หัวข้อดังกล่าวจะรวมหัวข้อของยุคปัจจุบันและ 2 ยุคก่อนหน้า
- เมื่อสิ้นสุดแต่ละยุคของเบราว์เซอร์ เบราว์เซอร์จะรวบรวมรายการหน้าเว็บที่ตรงตามเกณฑ์ต่อไปนี้
- ผู้ใช้เข้าชมหน้าเว็บระหว่างช่วงเวลาดังกล่าว
- หน้าเว็บมีโค้ดที่เรียก
document.browsingTopics()
- API เปิดใช้งาน (เช่น ไม่ได้ถูกบล็อกโดยผู้ใช้หรือส่วนหัวคำตอบ)
- เบราว์เซอร์ในอุปกรณ์ของผู้ใช้จะใช้รูปแบบตัวแยกประเภทที่ Topics API ระบุเพื่อจับคู่ชื่อโฮสต์ของหน้าเว็บแต่ละหน้ากับรายการหัวข้อ
เบราว์เซอร์จะสร้างรายการหัวข้อ 5 อันดับแรก
- หัวข้อรูท 22 หัวข้อในการจัดหมวดหมู่แต่ละหัวข้อจะได้รับมอบหมายให้กลุ่ม "ยูทิลิตีสูง" หรือ "ยูทิลิตีมาตรฐาน" โดยอิงตามความคิดเห็นจากระบบนิเวศการโฆษณา โดยเบราว์เซอร์จะจัดเรียงหัวข้อตามการกำหนดที่เก็บก่อน หัวข้อที่สืบทอดทั้งหมดจะรับการกําหนดกลุ่มของหัวข้อรูทหลัก โดยระบบจะจัดลําดับความสําคัญให้กับหัวข้อ "ประโยชน์สูง"
- จากนั้นเบราว์เซอร์จะจัดเรียงหัวข้อตามความถี่ภายในแต่ละที่เก็บ
- ระบบจะเลือก 5 หัวข้อยอดนิยมจากรายการที่จัดเรียงนี้ให้เป็นหัวข้อยอดนิยมของผู้ใช้สำหรับ Epoch นั้นๆ
จากนั้นเมธอด document.browsingTopics()
จะแสดงหัวข้อแบบสุ่มจาก 5 อันดับแรกสำหรับแต่ละ Epoch โดยมี 5% ที่ระบบจะสุ่มหัวข้อเหล่านี้จากการจัดหมวดหมู่หัวข้อทั้งหมด ใน Chrome ผู้ใช้ยังนำหัวข้อแต่ละหัวข้อออกหรือล้างประวัติการท่องเว็บเพื่อลดจำนวนหัวข้อที่ API แสดงผลได้ด้วย นอกจากนี้ ผู้ใช้ยังเลือกไม่ใช้ API ได้ด้วย
คุณสามารถดูข้อมูลเกี่ยวกับหัวข้อที่สังเกตได้ในช่วงปัจจุบันได้จากหน้า chrome://topics-internals
Next steps
Setup
Implement Topics
ดูเพิ่มเติม
ดูแหล่งข้อมูลของเราเพื่อทำความเข้าใจเกี่ยวกับ Topics API บนเว็บให้ดียิ่งขึ้น
- ลองดูวิดีโอเดโม วิดีโอที่ทำร่วมกัน และวิดีโอคำแนะนำแบบทีละขั้นจาก Topics
- ดูรายการ Flag ของ Chrome ที่อนุญาตให้นักพัฒนาซอฟต์แวร์ปรับแต่ง Topics API สำหรับการทดสอบ
- ดูวิธีที่ผู้ใช้และนักพัฒนาแอปควบคุม API ได้
- ดูแหล่งข้อมูลสําหรับคำอธิบายและการสนับสนุนทางเทคนิค ถามคำถาม มีส่วนร่วม และแชร์ความคิดเห็น