Opt Out of Google FLOC for Site Visitors (One Line of Code)

Google has another new thing they are doing, called FLOC (Federated Learning of Cohorts). It’s used to — surprise — track user activity across websites. Opting out ideally is handled by the user, who can customize their browser settings to disable FLOC while surfing around the Web. Beyond configuring your browser to opt-out of FLOC, you can disable it on any website with a single line of code. Opt-out your site To opt any website or web page out of […]


This content originally appeared on Perishable Press and was authored by Jeff Starr

Floc of Sheep

Google has another new thing they are doing, called FLOC (Federated Learning of Cohorts). It’s used to — surprise — track user activity across websites. Opting out ideally is handled by the user, who can customize their browser settings to disable FLOC while surfing around the Web. Beyond configuring your browser to opt-out of FLOC, you can disable it on any website with a single line of code.

Opt-out your site

To opt any website or web page out of the FLOC monitoring program, add the following Permissions-Policy header to your page(s):

Permissions-Policy: interest-cohort=()

You can read all of the details about this header in the official spec. And remember, this disables Google FLOC data collection on your site only. Once the visitor leaves your site, their activity may be tracked by FLOC elsewhere on the Web (unless it is disabled in their browser settings).

How to add via Apache/.htaccess

As explained in my tutorial on adding custom HTTP headers with .htaccess, we can use Apache’s Header set directive to add the Permissions-Policy header to the entire site:

Header set Permissions-Policy "interest-cohort=()"

Add that line to your site’s public/root .htaccess file, save changes, and done. Instant relief from Google’s latest data harvesting protocol for all of your site visitors.



This content originally appeared on Perishable Press and was authored by Jeff Starr


Print Share Comment Cite Upload Translate Updates
APA

Jeff Starr | Sciencx (2021-04-28T22:01:27+00:00) Opt Out of Google FLOC for Site Visitors (One Line of Code). Retrieved from https://www.scien.cx/2021/04/28/opt-out-of-google-floc-for-site-visitors-one-line-of-code/

MLA
" » Opt Out of Google FLOC for Site Visitors (One Line of Code)." Jeff Starr | Sciencx - Wednesday April 28, 2021, https://www.scien.cx/2021/04/28/opt-out-of-google-floc-for-site-visitors-one-line-of-code/
HARVARD
Jeff Starr | Sciencx Wednesday April 28, 2021 » Opt Out of Google FLOC for Site Visitors (One Line of Code)., viewed ,<https://www.scien.cx/2021/04/28/opt-out-of-google-floc-for-site-visitors-one-line-of-code/>
VANCOUVER
Jeff Starr | Sciencx - » Opt Out of Google FLOC for Site Visitors (One Line of Code). [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/04/28/opt-out-of-google-floc-for-site-visitors-one-line-of-code/
CHICAGO
" » Opt Out of Google FLOC for Site Visitors (One Line of Code)." Jeff Starr | Sciencx - Accessed . https://www.scien.cx/2021/04/28/opt-out-of-google-floc-for-site-visitors-one-line-of-code/
IEEE
" » Opt Out of Google FLOC for Site Visitors (One Line of Code)." Jeff Starr | Sciencx [Online]. Available: https://www.scien.cx/2021/04/28/opt-out-of-google-floc-for-site-visitors-one-line-of-code/. [Accessed: ]
rf:citation
» Opt Out of Google FLOC for Site Visitors (One Line of Code) | Jeff Starr | Sciencx | https://www.scien.cx/2021/04/28/opt-out-of-google-floc-for-site-visitors-one-line-of-code/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.