透過示範和 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
The Attribution Reporting API enables advertisers and ad tech providers to measure conversions for ad clicks and views, ads in a third-party iframe, and ads in a first-party context. In this demo an advertiser uses an ad tech provider to run their ads on a publisher site.
Demo
Noise Lab
When aggregatable reports are batched by a collector and processed by the aggregation service, random data is added to the resulting summary reports in order to protect user privacy. Use Noise Lab to experiment with different values to see the impact of noise.
匯總服務
匯總服務負責解密及合併可匯總報表收集的資料、加入雜訊,並傳回最終摘要報表。這一切都會在受信任的執行環境 (TEE) 中完成。
Colab
共用儲存空間
Shared Storage API 提供可跨網站使用的儲存空間,也就是說,您可以在一個網域儲存值,然後從另一個網域讀取該值。您可以隨意設定資料,但從儲存空間移出資料的方式有限。這個範例會示範如何使用。
CHIPS
具有獨立分區狀態的 Cookie (CHIPS) 可讓開發人員選擇將 Cookie 儲存在分區中,每個頂層網站都有各自的 Cookie 罐,進而提升使用者隱私權和安全性。這個範例會示範如何使用。
相關網站集合
相關網站集合可讓公司聲明網站之間的關係,以便瀏覽器允許基於特定目的的第三方 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 framework offers cookbook recipes, sample code, and demo applications, based on Privacy Sandbox APIs. These are intended to aid businesses and developers in adapting their applications and the businesses they support to a web ecosystem without third-party cookies.
| Use case | Description | APIs |
|---|---|---|
| Retargeting / Remarketing | How to show relevant ads to a user who has researched a brand or product online. | Protected Audience API Fenced Frame |
| Single-touch conversion Attribution | How to measure conversion after seeing ads on a news site and buying a product on an online shopping site. | Attribution Reporting API |
| Instream VAST video ad in a Protected Audience single-seller auction | Provides details on a temporary solution allowing Top Level embedded video players access to the VAST XML URL. | Protected Audience API |
| Instream VAST video ad in a Protected Audience sequential auction setup | Shows one of the ways that VAST XMLs can be handled in a Protected Audience sequential auction setup when the ad is rendered in an iframe. | Protected Audience API |