透過示範和 Colab 逐步說明 Privacy Sandbox API。
我們提供多個 Privacy Sandbox API 的示範。大多數的示範都需要您熟悉 API,因此如果您尚未閱讀說明文件,請查看我們提供的示範連結。
示範和 Colab
Protected Audience API
The demo uses the Protected Audience API to join ad interest groups on two advertiser sites, and then initiates an on-device auction to select an ad for display on a publisher site.
Topics API
透過 Topics API,使用者的裝置會根據活動觀察並記錄使用者感興趣的主題。接著,API 會允許呼叫端 (例如廣告技術平台) 存取這些主題,但不會揭露使用者的其他活動資訊。下列資源提供 API 實際運作的範例。
網頁主題資源
- 標題示範:建議採用這種做法,成效較佳。
- JavaScript 示範:如果無法修改標頭,請使用 JavaScript Topics 方法。
- Topics API Colab:使用 Chrome 用於從主機名稱推斷主題的 TensorFlow Lite 模型進行實驗。
- 網頁適用的 Topics 說明文件:進一步瞭解 Topics 的運作方式和實作方法。
Android 主題相關資源
- 範例應用程式:請參閱 Kotlin 範例應用程式或 Java 範例應用程式,瞭解如何整合。
- Topics API Colab:針對主題分類器模型測試不同的應用程式資訊組合。
- Android 適用的 Topics 說明文件:瞭解 Topics 在 Android 上的運作方式。
歸因報表
廣告主和廣告技術供應商可透過 Attribution Reporting API 評估廣告點擊和瀏覽、第三方 iframe 中的廣告,以及第一方環境中的廣告轉換次數。在本示範中,廣告主會使用廣告技術供應商,在發布商網站上放送廣告。
示範模式
Noise Lab
當收集器批次處理可匯總報表,並由匯總服務處理時,系統會在產生的摘要報表中加入隨機資料,以保護使用者隱私。使用 Noise Lab 實驗不同的值,瞭解雜訊的影響。
匯總服務
匯總服務負責解密及合併可匯總報表收集的資料、加入雜訊,並傳回最終摘要報表。這一切都會在受信任的執行環境 (TEE) 中完成。
Colab
Shared Storage
The Shared Storage API provides storage that can be used cross-site, meaning you store a value at one domain, then read the value from another domain. You can set data freely, but are restricted in how you get data out of storage. This demo illustrates how it works.
CHIPS
具有獨立分區狀態的 Cookie (CHIPS) 可讓開發人員選擇將 Cookie 儲存在分區中,每個頂層網站都有各自的 Cookie 罐,進而提升使用者隱私權和安全性。這個範例會示範如何使用。
Related Website Sets
Related Website Sets is a way for a company to declare relationships among sites, so that browsers allow limited third-party cookie access for specific purposes. Chrome will use these declared relationships to decide when to allow or deny a site access to their cookies when in a third-party context.
- Demo
- Submission JSON generator.This tool generates the JSON resources needed to make a Related Website Sets (RWS) submission.
- Docs
Permissions Policy
Permissions Policy allows the developer to control the browser features available to a page, its iframes, and subresources, by declaring a set of policies for the browser to enforce. This demo lets you try out the available policies.
使用者代理程式縮減
縮減使用者代理程式可盡量減少使用者代理程式字串分享的識別資訊,以免遭人用於被動式數位指紋採集。資源要求的 User-Agent 標頭現在會縮減,特定 Navigator 介面的傳回值也會縮減。您可以在這個示範中實驗新的 UA 字串值。
Private State Token API
With the Private State Token API, a website can issue cryptographic tokens to a user it trusts, which can later be used elsewhere. The tokens are stored securely by the user's browser, and can then be redeemed in other contexts to confirm the user's authenticity. Check out the API in this demo.
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 |