Relevance and measurement unified origin trial

Run unified experiments across Attribution Reporting, FLEDGE, Topics, Fenced Frames, and Shared Storage.

Published on Updated on

Translated to: 日本語

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, FLEDGE, Topics, Fenced Frames, and Shared Storage.

Developers can sign up for this single origin trial that allows you to test across the Topics, FLEDGE, 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.

Check the status of the origin trial

January 2023

As part of a Chrome regression investigation, we will temporarily reduce FLEDGE 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.

APINotes
Attribution ReportingAvailable in Stable, increased to 5% from October 26th 2022.
TopicsAvailable in Stable, increased to 5% from October 26th 2022.
FLEDGEAvailable in Stable, temporarily decreasing to 4% from January 26th 2023.
Fenced FramesAvailable in Stable, increasing to 5% from November 9th 2022.
Shared StorageAvailable in Stable, increasing 5% from January 26th 2023.

Previous updates

Check out previous updates on the origin trial.

November 2022

Shared 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 FLEDGE and Fenced Frames also following on November 9th.

APINotes
Attribution ReportingAvailable in Stable, increased to 5% from October 26th.
TopicsAvailable in Stable, increased to 5% from October 26th.
FLEDGEAvailable in Stable, increasing to 5% from November 9th.
Fenced FramesAvailable in Stable, increasing to 5% from November 9th.
Shared StorageWill be available in Stable, starting at 1% from November 9th.

October 2022: 5% increase

Attribution Reporting, Topics, FLEDGE, 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, FLEDGE 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.

APINotes
Attribution ReportingAvailable in Stable, increasing to 5% after October 26th.
TopicsAvailable in Stable, increasing to 5% after October 26th.
FLEDGEAvailable in Stable, increasing to 5% from November 9th.
Fenced FramesAvailable in Stable, increasing to 5% from November 9th.
Shared StorageOnly available in M105+ Canary, Dev, and Beta for now.

October 2022

This 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:

APINotes
Attribution ReportingDeveloper guide for the origin trial.
FLEDGEDeveloper guide for the origin trial.
TopicsDeveloper guide for the origin trial.
Fenced FramesSee the FLEDGE guidance for origin trial usage.
Shared StorageOnly available in M105+ Canary, Dev, and Beta for now.

August 2022

  • Origin trial availability ramps up to 1% of desktop users from Chrome Stable 104.

    • Updates will follow when the availability includes mobile users.
  • Pre-stable channels (Canary, Beta) remain at 50% of users.

  • APIs are not available on iOS Chrome.

May 2022

Origin trial availability ramps up to 50% of users from Chrome 102 Beta. APIs included in the trial:

APINotes
Attribution ReportingDeveloper guide for the origin trial.
FLEDGEDeveloper guide for the origin trial.
TopicsDeveloper guide for the origin trial. Topics was briefly disabled in the origin trial due to a bug that affected browser stability.
Fenced FramesFenced Frames added to the origin trial. See the FLEDGE guidance for experiment usage.

April 2022

Origin trial begins with a limited proportion of users from Chrome 102 Beta. APIs included in the trial:

APINotes
Attribution ReportingIndividual Intent to Experiment (I2E) post. Attribution Reporting also available as an individual origin trial.
FLEDGEIndividual Intent to Experiment (I2E) post. FLEDGE available on desktop only with a subset of functionality.
TopicsIndividual Intent to Experiment (I2E) post.

Sign up for and configure the origin trial

To 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.

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 FLEDGE's joinAdInterestGroup()), then the token needs to be provided within the iframe and match the iframe's origin.

Configure cross-site with JavaScript

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:

  • Select the Third-party matching option when registering for the origin trial.
  • The Web Origin field should be the origin of your script.
  • Inject the <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.
  1. Scroll down to the Frames pane.
  2. Select the frame where you expect to set the token. For example, the top frame for the top-level page or the specific iframe for embedded pages.
  3. In the right-hand pane scroll down to the Origin Trials section.
  4. You should see an entry for the PrivacySandboxAdsAPIs trial.
  5. Expand this entry to see the status for the origin trial and your specific tokens.

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.

Token Success status and not 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 features

As 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) {
// FLEDGE 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 settings

For 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.

User settings

For a user to be eligible for the trial, they must also:

  • have the Privacy Sandbox trial enabled via Settings > Security and privacy > Privacy Sandbox, also accessible via chrome://settings/privacySandbox.
  • have third-party cookies enabled via Settings > Security and privacy > Cookies and other site data set to either "Allow all cookies" or "Block third-party cookies in incognito", also accessible via chrome://settings/cookies.
  • be in a standard browsing session and not Incognito mode.

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 trial

The 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.

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:

  1. Include the origin trial tokens by default in all contexts where you wish to experiment.
  2. Use feature detection to check for active APIs.
  3. If the APIs are active (and therefore, the browser is eligible for this experiment), choose whether or not to use them based on your own experiment criteria. For example, if you already have A/B testing infrastructure to experiment on a percentage of traffic, sampling, or some other attribute, then at this point you can decide which features you will actively use.

You can prevent participation in the origin trial entirely for any browser instance by not including the token in the response. For instance, 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.

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 locally

For 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:

  • Use a version and channel of Chrome where the features are available.
  • Enable the chrome://flags/#privacy-sandbox-ads-apis flag.
    • Additional flags may conflict with this one, so consider only setting this one flag if you experience issues.

Check the developer guides for availability of specific APIs and features and additional flags for more fine-grained configuration.

Updated on Improve article

We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.