V for Vendetta-style Guy Fawes masks

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.


last updated on 24 May 2021 by @andycroll

photo by
Ahmed Zayan

Don’t miss my next post, sign up to the One Ruby Thing email and get my next post in your inbox.

Don’t miss my next post, sign up to the One Ruby Thing email and get my next post in your inbox.