Relevance and measurement unified origin trial

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

Published on

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

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.

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 StorageShared Storage added to the origin trial in only M105+ Canary, Dev, and Beta for now.

Previous updates

Check out previous updates on the origin trial.

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

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.

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
}

Determine which of your users are eligible

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.

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.

Last updated: Improve article

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