Stay organized with collections Save and categorize content based on your preferences.
Topics, Fenced Frames, and Shared Storage. keywords: product:PrivacySandbox, docType:Guide, topicAdSetup, contentTypeSolution, category:Web, apiGroupAds, audienceAdBuyer, audienceAdSeller, audienceAdMeasurementProvider, skill:Beginner
The Privacy Sandbox includes a selection of proposals to enable advertising use cases without the need for cross-site tracking. Origin trials provide an opportunity for developers to evaluate and provide feedback on new web technologies through real-world testing. The Privacy Sandbox Relevance and Measurement origin trial provides a single trial allowing sites to run unified experiments across Attribution Reporting, Protected Audience API, Topics, Fenced Frames, and Shared Storage. Developers can sign up for this single origin trial that allows you to test across the Topics, Protected Audience API, and Attribution Reporting APIs. This guide takes you through the configuration steps to access the APIs, tells you how to validate your configuration, and provides further resources for testing against the APIs.
Key Term: Traffic refers to the percentage of Chrome browser instances included in the trial, not the percentage of requests made to individual sites. Check the status of the origin trial June 2023 Private Aggregation 7% ramp-up in StablePrivate Aggregation API will be available at 7% of Chrome Stable traffic from Tuesday, June 6, 2023. The API will be available in the main unified origin trial group (5%), Protected Audience isolated group (1%), and Shared Storage isolated group (1%). The traffic allocation for Protected Audience and Shared Storage will not change since Private Aggregation is being added to existing isolated experiments.
Traffic allocation as of Tuesday, June 6th:
API Traffic allocation Status Attribution Reporting Unified - 5% 6% of Stable traffic as of March 13, 2023 Isolated - 1% - ARA only Fenced Frames Unified - 5% 7% of Stable traffic as of March 13, 2023 Isolated - 1% - Shared Storage + Private Aggregation + Fenced Frames only Isolated - 1% - Protected Audience + Private Aggregation + Fenced Frames only Protected Audience Unified - 5% 6% of Stable traffic as of March 13, 2023 Isolated - 1% - Protected Audience + Private Aggregation + Fenced Frames only Private Aggregation Unified - 5% 7% of Stable traffic as of June 6, 2023 Isolated - 1% - Protected Audience + Private Aggregation + Fenced Frames only Isolated - 1% - Shared Storage + Private Aggregation + Fenced Frames only Shared Storage Unified - 5% 6% of Stable traffic as of March 13, 2023 Isolated - 1% - Shared Storage + Private Aggregation + Fenced Frames only Topics Unified - 5% 6% of Stable traffic as of March 13, 2023 Isolated - 1% - Topics only Previous updatesCheck out previous updates on the origin trial.
April 2023 Private Aggregation 1% ramp-up in StableThe Private Aggregation API origin trial will be available at 1% of Chrome Stable unified experiment traffic from Monday April 17. The sendHistogramReport()
function of Private Aggregation is available to be used in Protected Audience API and Shared Storage worklets.
The traffic allocation will look like the following starting on Monday, April 17:
API Traffic allocation Status Attribution Reporting Unified - 5% 6% of the Stable traffic starting from March 13, 2023 Isolated - 1% - ARA only Fenced Frames Unified - 5% 7% of the Stable traffic starting from March 13, 2023 Isolated - 1% - Shared Storage (URL Selection) + Fenced Frames only Isolated - 1% - Protected Audience API + Fenced Frames only Protected Audience API Unified - 5% 6% of the Stable traffic starting from March 13, 2023 Isolated - 1% - Protected Audience API + Fenced Frames only Private Aggregation Unified - 1% 1% of the Stable traffic starting from April 17, 2023 Shared Storage (URL Selection) Unified - 5% 6% of the Stable traffic starting from March 13, 2023 Isolated - 1% - Shared Storage (URL Selection) + Fenced Frames only Topics Unified - 5% 6% of the Stable traffic starting from March 13, 2023 Isolated - 1% - Topics only March 2023 Timeline updateWe initially communicated that we will begin the isolated experiments on Monday, March 13, 2023, but the new experiments will now begin on Thursday, March 16, 2023 due to the additional time needed for setting up the experiments. The 1% Protected Audience API ramp back up from 4% to 5% will also occur on Thursday, March 16, 2023.
Protected Audience API 1% ramp back upLast month, we temporarily reduced Protected Audience API origin trial traffic from 5% to 4% of Chrome stable for testing. The initial testing has concluded, and we plan to ramp Protected Audience API back up to 5% from 4% for the unified experiment on Thursday, March 16, 2023.
The ramped-up users will be the same set of users that were ramped down. However, their previous interest groups have expired, since more than 30 days have passed since the ramp-down.
Isolated experimentsTo improve our testing process and continue observing the metrics of origin trial APIs, we're creating isolated experiments for each API, in addition to the existing unified experiment. New experiments will be created for Attribution Reporting, Topics, a combination of Protected Audience API and Fenced Frames, and a combination of Shared Storage's URL Selection operation and Fenced Frames. In each isolated experiment, only the assigned APIs will be available for the users in that group.
API Isolated experimentStarting Thursday, March 16, you will begin to receive an additional 1% of the Chrome Stable traffic for the APIs listed above, on top of the 5% traffic you are receiving from the existing unified experiment. New users will be allocated to each experiment.
Traffic allocationThe current unified origin trials traffic allocation as of Tuesday, February 28, is as follows:
API Current unified experimentThe traffic allocation will look like the following starting on Thursday, March 16, after Protected Audience API is ramped back up, and the new isolated experiments begin:
API New traffic allocation Status Attribution Reporting Unified - 5% 6% of the Stable traffic starting from March 16, 2023 Isolated - 1% - ARA only Fenced Frames Unified - 5% 7% of the Stable traffic starting from March 16, 2023 Isolated - 1% - Shared Storage (URL Selection) + Fenced Frames only Isolated - 1% - Protected Audience API + Fenced Frames only Protected Audience API Unified - 5% (4% current allocation + 1% ramp back up) 6% of the Stable traffic starting from March 16, 2023 Isolated - 1% - Protected Audience API + Fenced Frames only Shared StorageThese changes will not affect your existing origin trial token setup, and you will not have to renew or generate a new origin trial token.
January 2023As part of a Chrome regression investigation, we will temporarily reduce Protected Audience API origin trial traffic from 5% to 4% of Chrome Stable, from January 26th 2023. We estimate the investigation will take about a month, and we will notify you when the traffic is ramped back up.
This change will happen automatically, and will not impact your existing origin trial tokens. For the users in the 1% traffic that will ramp down, the interest groups will remain in their browsers. The same users will be part of the ramp back up, and their interest groups can be reused. However, the interest groups expire in 30 days, and the regression investigation may take longer than that.
Also, Shared Storage's URL Selection API origin trial will be increasing to 5% of Chrome Stable traffic from January 26th 2023.
API Notes Attribution Reporting Available in Stable, increased to 5% from October 26th 2022. Topics Available in Stable, increased to 5% from October 26th 2022. Protected Audience API Available in Stable, temporarily decreasing to 4% from January 26th 2023. Fenced Frames Available in Stable, increasing to 5% from November 9th 2022. Shared Storage Available in Stable, increasing 5% from January 26th 2023. November 2022Shared Storage's `selectURL` API will be joining the origin trial at 1% of Chrome Stable traffic from November 9th.
As previously announced in the Increasing the Privacy Sandbox Relevance and Measurement origin trial to 5% blog post, Attribution Reporting and Topics are now at 5% with Protected Audience API and Fenced Frames also following on November 9th.
October 2022: 5% increaseAttribution Reporting, Topics, Protected Audience API, and Fenced Frames are all currently available in Chrome Stable and will be part of the increased traffic.
We will start increasing traffic for Attribution Reporting and Topics from this week, Protected Audience API and Fenced Frames will increase from November 9th.
Read more in the Increasing the Privacy Sandbox Relevance and Measurement origin trial to 5% blog post.
October 2022This extension was granted to give the ecosystem time in Stable channel to continue testing and validating API improvements, while providing feedback consistent with our existing public timeline.
The overall Privacy Sandbox timeline remains unchanged.
APIs included in the trial:
August 2022Origin trial availability ramps up to 50% of users from Chrome 102 Beta.
APIs included in the trial:
April 2022Origin trial begins with a limited proportion of users from Chrome 102 Beta.
APIs included in the trial:
Sign up for and configure the origin trialTo activate the origin trial on your site, you will need to register and embed the assigned origin trial token (a time-based string for your specific access to the origin trial). Learn more in the Getting started with Chrome's origin trials.
Note: Register for the Privacy Sandbox Relevance and Measurement trial.Origin trial tokens are granted immediately, and you can revoke or recreate them at any time.
For every page where you want to use the origin trial, you will need to include a trial token with that specific page's HTML or response.
Use a <meta>
tag in the page's <head>
section:
<meta http-equiv="origin-trial" content="TOKEN_GOES_HERE">
Alternatively, include the following HTTP header in the page response:
Origin-Trial: TOKEN_GOES_HERE
Configure with an iframe
If you're using origin trial features within an iframe (such as Protected Audience API's joinAdInterestGroup()
), then the token needs to be provided within the iframe and match the iframe's origin.
If you are using origin trial features via cross-site JavaScript, as in you are the provider of third-party JavaScript that is included in the top-level page, then you will need to:
<meta>
tag into the top-level page (that is, the first-party page, not your own content) from your script. For example:const otMeta = document.createElement('meta');
otMeta.setAttribute('http-equiv', 'origin-trial');
otMeta.setAttribute('content', 'TOKEN_GOES_HERE');
document.querySelector('head').appendChild(otMeta);
Debug the origin trial
You can check the status for an origin trial in DevTools > Applications panel.
Token Success status and enabled.PrivacySandboxAdsAPIs
trial.The origin trial is limited to a fraction of Chrome users and your browser may not be in the experiment group. As a result, you may see a red TrialNotAllowed
message against PrivacySandboxAdsAPIs
. When you expand the entry to check Token Status, if it shows a green Success
message, your origin trial configuration is correct. Eligible users will see the message set to Enabled
.
If you see different messages, refer to Troubleshooting Chrome's origin trials for a detailed checklist to validate your configuration of the origin trial.
Detect featuresAs with all web features, you should check they are reporting as available in the browser before attempting to use them. You can do this by checking for the existence of the relevant API in the right location:
if (document.featurePolicy.allowsFeature('attribution-reporting')) {
// Attribution Reporting enabled
}
if ('runAdAuction' in navigator) {
// Protected Audience API enabled
}
if ('browsingTopics' in document) {
// Topics enabled
}
if ('HTMLFencedFrameElement' in window) {
// Fenced Frames enabled
}
if ('sharedStorage' in window) {
// Shared Storage enabled
}
if (window?.sharedStorage?.selectURL instanceof Function) {
// optionally check specifically for the selectURL function in Shared Storage
}
Determine user eligibility
The origin trial is running for a fraction of Chrome users. They must also have the relevant functionality enabled in their settings to be eligible for the trial:
Browser settingsFor a user to be eligible for the trial, they must:
Be using a version and channel of Chrome where the origin trial is running.
Be within the active experiment group in Chrome.
For a user to be eligible for the trial, they must also:
chrome://settings/adPrivacy
.chrome://settings/cookies
.While the origin trial will only show as active to eligible users, you can also use the developer flags to test against your own production site.
Control your participation in the origin trialThe mechanics of the origin trial remain the same: you obtain origin trial tokens for the contexts where you want to experiment with the APIs. With the expanded testing population, you should ensure that you are actively monitoring and controlling the level of traffic where you choose to enable the trial.
Note: 5% of Chrome Stable traffic won't directly correspond to 5% of your own traffic. The actual proportion of traffic your sites and services receive will depend on the make-up of your visitors.A good approach here is to:
You can prevent participation in the origin trial entirely for any browser instance by not including the token in the response. For example, if you have met your own quota for an experiment or need to address an issue during the trial, then not including the token ensures no experimental functionality will be available or active in the page.
Origin trial control by geographic regionYou cannot opt-out of an origin trial for specific regions. Origin trials are active on pages that contain the token, included via HTTP headers (server-side) or HTML meta tags (client-side).
If you can determine the user's location, then you could write code to include the origin trial token based on that location information. For example, you could attempt to use IP addresses to determine a user's location. IP addresses can be spoofed, so this is not a guaranteed solution.
However, a geographic-specific origin can set a Permissions Policy to control what features are usable. For example, us.example.com
and uk.example.com
are geographic-specific origins which can be controlled. This does not mean that a region has opted-out of the origin trial.
With a Permissions Policy, a site adds a little snippet of code to their pages that provides instructions to the browser. When the page loads, the browser reads the Permission Policy instructions and will allow or block features (or APIs) as outlined in the Permissions Policy. If a site wants to restrict an API in a specific region, the developer could set a policy for all pages requested from that region.
Warning: Users may choose to visit an origin from a region that's different from where they are. In other words, a user in the United States may be able to visituk.example.com
. Those users would see features and functions for the United States site that were blocked for the United Kingdom site. Renew your token
Origin trial tokens expire six weeks from their issue date (or at the end of the trial if that's sooner).
It's critical that you renew and deploy your new tokens within that window for uninterrupted use of the origin trial features.
Renewing tokens only takes a few minutes, and you can deploy multiple tokens for the same trial within the same page. You can deploy a renewed token before your existing token expires, so there's no break in service for users.
Caution: Renewing a token at the end of October only takes you through to early December. If you have a code freeze over the end of the year, you will either want to ensure that you can still deploy an updated token or plan to pause participation in the origin trial over that period. Test locallyFor specific guidance on local developer testing, see:
The APIs are not on by default and must be enabled with flags for testing. You should ensure that you have the same configuration settings enabled above and then:
chrome://settings/adPrivacy
.Check the developer guides for availability of specific APIs and features and additional flags for more fine-grained configuration.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-03-13 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-03-13 UTC."],[],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.3