透過示範和 Colab 逐步說明 Privacy Sandbox API。
我們提供多個 Privacy Sandbox API 的示範。大多數的示範都需要您熟悉 API,因此如果您尚未閱讀說明文件,請查看我們提供的示範連結。
示範和 Colab
Protected Audience API
這個範例會使用 Protected Audience API,在兩個廣告主網站上加入廣告興趣群組,然後啟動裝置端競價,選取要在發布商網站上顯示的廣告。
Topics API
With the Topics API, a user's device observes and records topics that appear to be of interest to the user based on their activity. The API then allows callers (such as ad tech platforms) to access these topics without revealing other information about the user's activity. The following resources provide examples of the API in action.
Resources for Topics on the Web
- Headers demo: This is a recommended, more performant approach.
- JavaScript demo: Use JavaScript Topics methods if you can't modify headers.
- Topics API colab: Experiment with the TensorFlow Lite model used by Chrome to infer topics from hostnames.
- Topics documentation for the Web: Learn more about how Topics work and how to implement it.
Resources for Topics on Android
- Sample apps: Refer to Kotlin sample app or Java sample app to guide your integration.
- Topics API colab: Test different combinations of app info against the topics classifier model.
- Topics documentation for Android: Learn how Topics works on Android.
歸因報表
廣告主和廣告技術供應商可透過 Attribution Reporting API 評估廣告點擊和瀏覽、第三方 iframe 中的廣告,以及第一方環境中的廣告轉換次數。在本示範中,廣告主會使用廣告技術供應商,在發布商網站上放送廣告。
示範模式
Noise Lab
當收集器批次處理可匯總報表,並由匯總服務處理時,系統會在產生的摘要報表中加入隨機資料,以保護使用者隱私。使用 Noise Lab 實驗不同的值,瞭解雜訊的影響。
匯總服務
匯總服務負責解密及合併可匯總報表收集的資料、加入雜訊,並傳回最終摘要報表。這一切都會在受信任的執行環境 (TEE) 中完成。
Colab
共用儲存空間
Shared Storage API 提供可跨網站使用的儲存空間,也就是說,您可以在一個網域儲存值,然後從另一個網域讀取該值。您可以隨意設定資料,但從儲存空間移出資料的方式有限。這個範例會示範如何使用。
CHIPS
Cookies Having Independent Partitioned State (CHIPS) allows developers to opt a cookie into partitioned storage, with separate cookie jars per top-level site, improving user privacy and security. This demo illustrates how it works.
相關網站集合
相關網站集合可讓公司聲明網站之間的關係,以便瀏覽器允許基於特定目的的第三方 Cookie 有限存取權。Chrome 會根據這些聲明的關係,決定在第三方情境中允許或拒絕網站存取 Cookie。
- 示範模式
- 提交 JSON 產生器:這個工具會產生提交相關網站組合 (RWS) 時所需的 JSON 資源。
- 文件
使用者代理程式縮減
縮減使用者代理程式可盡量減少使用者代理程式字串分享的識別資訊,以免遭人用於被動式數位指紋採集。資源要求的 User-Agent 標頭現在會縮減,特定 Navigator 介面的傳回值也會縮減。您可以在這個示範中實驗新的 UA 字串值。
Private State Token API
網站可透過 Private State Token API,向信任的使用者核發加密權杖,供日後在其他地方使用。權杖會由使用者的瀏覽器安全儲存,然後在其他情境中兌換,以確認使用者的真實性。請參閱這個示範中的 API。
Privacy Sandbox Demos Framework
Privacy Sandbox Demos 架構提供以 Privacy Sandbox API 為基礎的食譜、程式碼範例和示範應用程式。這些指南旨在協助商家和開發人員調整應用程式,並支援商家適應沒有第三方 Cookie 的網路生態系統。
| 用途 | 說明 | API |
|---|---|---|
| 指定舊訪客 / 再行銷 | 如何向在網路上研究過品牌或產品的使用者顯示相關廣告。 | Protected Audience API Fenced Frame |
| 單一接觸點轉換歸因 | 如何評估在新聞網站上看到廣告,然後在網路購物網站上購買產品後的轉換。 | Attribution Reporting API |
| Protected Audience 單一賣方競價中的串流內 VAST 影片廣告 | 提供臨時解決方案的詳細資料,允許頂層內嵌影片播放器存取 VAST XML 網址。 | Protected Audience API |
| 在 Protected Audience 連續競價設定中放送串流內 VAST 影片廣告 | 顯示在 iframe 中算繪廣告時,於 Protected Audience 連續競價設定中處理 VAST XML 的其中一種方式。 | Protected Audience API |