V for Vendetta-style Guy Fawes masks

Ahmed Zayan

Opt out of Google’s FLoC User Tracking on Netlify

Google has recently built FLoC user-tracking into Chrome.

I covered how to opt out of FLoc in a Ruby on Rails application but a few of my sites—including this use Jekyll, hosted on Netlify.

Add…

…a custom response header to your Netlify configuration.

netlify.toml

[[headers]]
  for = "/*"
  [headers.values]
    Permissions-Policy = "interest-cohort=()"

Or…

… a specific headers file.

_headers

/*
  Permissions-Policy: interest-cohort=()

For Jekyll you’ll need to add the following to ensure the the headers configuration ends up in the folder you are deploying.

_config.yml

# ...
include: [_headers]
# ...

Why? Why not?

I covered the “why” in the original article.

Sign up to get a nugget of Ruby knowledge every couple of weeks or so.

Last updated on May 24th, 2021