How to take part in the FLoC origin trial
Federated Learning of Cohorts (FLoC) provides a privacy-preserving mechanism for interest-based ad selection. As a user moves around the web, their browser uses the FLoC algorithm to work out its "interest cohort", which will be the same for thousands of browsers with a similar recent browsing history. The user's browser is associated with one interest cohort at a time and recalculates its cohort periodically (currently once every seven days during this initial origin trial) on the user's device, without sharing individual browsing data with the browser vendor or anyone else.
To find out more about FLoC, see What is Federated Learning of Cohorts (FLoC).
Take part in the origin trial #
First-party context #
To access interest cohort data on your own site(s), add the origin trial token to your web pages, using one of the following methods:
As a meta tag in the <head> of each page served:
<meta http-equiv="origin-trial" content="TOKEN_GOES_HERE">
As an HTTP header:
With this in place, you can try out FLoC in a first-party context: for example, to observe cohorts for visitors to your site(s).
Third-party context #
You will need to inject the origin trial token in a meta tag in order to test the FLoC API in your code on third-party sites. Origin Trials Guide for Web Developers explains how to do this.
Submit feedback #
Do this through Chrome's origin trial site. This feedback is not public and is available only to a limited group of people on the Chrome team.
When your token expires, you will get an email with a renewal link. Before renewing the token, you are again asked to submit feedback.
Try out FLoC as a web developer #
The FLoC API is very simple: just a single method that returns a promise that resolves to an object providing the cohort
The cohort data made available looks like this:
The FLoC API is available in Chrome 89 and above, but if you're not taking part in the origin trial, you will need to set flags and run Chrome from the command line. Run Chromium with flags explains how to do this for different operating systems.
Start Chrome with the following flags:
Make sure third-party cookies are not blocked and that no ad blocker is running.
View the demo at floc.glitch.me.
Try out FLoC as a publisher, advertiser or adtech platform #
The FLoC API explainer suggests use cases, but does not define how the API should be used. Different sites and services will have different constraints and requirements for using FLoC to provide relevant content and ads.
If you manage your own technology for content recommendations, advertising or marketing services then you could apply your FLoC insights to tailor content or marketing messages to specific cohorts. If you rely on third party companies to provide these services then it might make more sense for them to join the origin trial and run experiments including your site and other sites.
As an example, for a publisher finding ways to select relevant content, the process of trying out FLoC during the origin trial might work something like this:
- Collect data about site usage and cohort IDs.
- Analyze the data for correlations. Use the data to select relevant content.
- Compare the FLoC approach against other mechanisms. Did it work the way you expect it?
- Adjust the use of FLoC to select content.
- Provide origin trial feedback.
How can websites opt out of the FLoC computation? #
A site should be able to declare that it does not want to be included in the user's list of sites for cohort calculation. A new
interest-cohort permissions policy enables this. The policy will be
allow by default.
For any frame that is not allowed
interest-cohort permission, the promise returned when it calls
document.interestCohort() will reject. If the main frame does not have
interest-cohort permission then the page visit will not be included in interest cohort calculation.
For example, a site can opt out of all FLoC cohort calculation by sending the HTTP response header:
During the FLoC origin trial, pages on websites that don't opt out will be included in the FLoC calculation if Chrome detects that they load ads-related resources or if they use
document.interestCohort(). Pages served from private IP addresses, such as intranet pages, won't be part of the FLoC computation.
Ad Tagging in Chromium explains how Chrome's ad detection mechanism works.
Find out more #
- What is Federated Learning of Cohorts (FLoC)?
- Getting started with Chrome's origin trials: a basic overview.
- Origin trials guide for web developers: additional technical detail and an extensive FAQ.
- Origin trial explainer: motivations and design for origin trial provision, with an extensive FAQ.
- Running an origin trial: technical detail from a Chrome and Chromium perspective.
- Process for launching new features in Chromium: how new features make their way to browser implementation.