Murmuration of starlings over Brighton pier

How to take part in the FLoC origin trial

Published on Updated on

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 #

The trial will start in Chrome 89, and will be made available as a third-party origin trial.
You will need to register for a FLoC origin trial token.

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:

    Origin-Trial: TOKEN_GOES_HERE

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 id and version:

document.interestCohort()

The cohort data made available looks like this:

    {
"id": "14159",
"version": "chrome.1.0"
}

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.

  1. Start Chrome with the following flags:

    --enable-blink-features=InterestCohortAPI 
    --enable-features="FederatedLearningOfCohorts:update_interval/10s/minimum_history_domain_size_required/1,FlocIdSortingLshBasedComputation,InterestCohortFeaturePolicy"
  2. Make sure third-party cookies are not blocked and that no ad blocker is running.

  3. 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:

  1. Collect data about site usage and cohort IDs.
  2. Analyze the data for correlations. Use the data to select relevant content.
  3. Compare the FLoC approach against other mechanisms. Did it work the way you expect it?
  4. Adjust the use of FLoC to select content.
  5. Provide origin trial feedback.
  6. Repeat.

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:

Permissions-Policy: interest-cohort=()

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 #


Photo by Rhys Kentish on Unsplash.

Last updated: Improve article

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