Opting Out of FLoC (Federated Learning of Cohorts)
Protect your users' privacy by explicitly opting your site out of Google's controversial FLoC tracking system.
Quick Answer: How to Block FLoC Using the Permissions-Policy Header
To block FLoC (Federated Learning of Cohorts) from tracking user activity on your website, you must serve the Permissions-Policy HTTP response header with the interest-cohort directive set to empty. This opts your domain out of Google's cohort calculation algorithm.
Add the following header to your web server configuration:
Permissions-Policy: interest-cohort=()
Implementation Examples:
- Nginx:
add_header Permissions-Policy "interest-cohort=()"; - Apache:
Header always set Permissions-Policy "interest-cohort=()" - Node.js:
res.setHeader("Permissions-Policy", "interest-cohort=()");
By adding this header, your site explicitly refuses to participate in cohort-based advertising profiles, enhancing the overall privacy and security posture of your platform.
People Also Ask (PAA)
Is FLoC still active?
Google officially abandoned the FLoC proposal in early 2022 after widespread industry backlash, replacing it with the Topics API. However, legacy configurations and the broader concept of cohort tracking remain a concern, making it best practice to explicitly disable interest-cohort via Permissions-Policy.
What is the interest-cohort Permissions-Policy?
The interest-cohort directive is a specialized instruction within the Permissions-Policy HTTP header that tells the browser whether the current site should be included in the calculation of a user's advertising cohort. Setting it to () completely disables this feature.
Does my website automatically participate in FLoC?
Yes. In the original design by Google, websites that did not explicitly opt out using the interest-cohort=() header were automatically included in the cohort calculations by participating browsers (like Chrome), effectively forcing site owners to opt-out rather than opt-in.
Introduction: The Battle for Privacy and the Rise of FLoC
The digital landscape is undergoing a massive shift towards privacy-first browsing. With the imminent deprecation of third-party tracking cookies, technology giants have been scrambling to find alternative methods to deliver targeted advertising without relying on individualized tracking. Enter FLoC-the Federated Learning of Cohorts. Proposed by Google as part of the Privacy Sandbox initiative, FLoC aimed to group users with similar browsing behaviors into "cohorts."
While FLoC was marketed as a privacy-preserving alternative to third-party cookies, it drew severe criticism from cybersecurity experts, privacy advocates (like the Electronic Frontier Foundation), and competing browser vendors. The consensus was clear: FLoC simply replaced one tracking vector with another, potentially facilitating new forms of browser fingerprinting.
For Web Developers, Security Engineers, and System Administrators, understanding how to block FLoC and implement robust Privacy Headers is a critical component of modern web security. At SecHead, we believe in a privacy-by-default internet. In this comprehensive guide, we will explore the technical mechanics of FLoC, why opting out is vital, and how to effectively deploy the Permissions-Policy: interest-cohort=() header across various web servers and application stacks.
What Exactly is FLoC (Federated Learning of Cohorts)?
The Mechanics of Cohort Calculation
Before diving into how to block it, it is crucial to understand how FLoC was designed to operate. Traditional advertising relies on third-party cookies dropping unique identifiers on a user's machine, allowing ad networks to build a granular profile of individual browsing histories across the web.
FLoC flipped this model by shifting the profiling mechanism from the cloud to the user's browser.
- Local Browsing History Analysis: The Chrome browser continuously analyzes the user's browsing history locally.
- SimHash Algorithm: It uses a machine learning model (specifically a variation of the SimHash algorithm) to assign the browser a "Cohort ID."
- Cohort Assignment: A Cohort ID represents a group of thousands of people with similar recent browsing activities.
- Broadcasting the ID: When the user visits a website, the browser exposes this Cohort ID to the site and its embedded ad scripts via a JavaScript API (
document.interestCohort()).
<strong>Critical Privacy Flaw:</strong> While FLoC anonymizes individual history, the Cohort ID itself is highly descriptive. If an attacker correlates a Cohort ID with other fingerprinting metrics (like IP address, user-agent, or canvas fingerprint), it drastically reduces the anonymity set, making individual identification easier, not harder.
The Controversy and Backlash
The security and privacy community forcefully rejected FLoC. Key criticisms included:
- Opt-Out vs. Opt-In: Google made FLoC an opt-out mechanism. Unless site administrators explicitly sent a header blocking it, their site data was used to calculate the user's cohort.
- Sensitive Categories: Critics warned that cohort IDs could inadvertently reveal sensitive user traits (e.g., medical conditions, sexual orientation, political affiliations) if those sites heavily influenced the assigned cohort.
- Browser Fingerprinting: As mentioned, the Cohort ID acts as an additional high-entropy data point for device fingerprinting algorithms.
Why You Must Block FLoC on Your Website
Even if you do not run advertisements on your platform, allowing your website to participate in cohort calculation has negative implications. Here is why you should definitively block FLoC using Privacy Headers.
1. Protecting User Privacy
Your users trust you with their data. When they visit your site, they do not expect their interaction with your content to be bundled into an algorithmic profile used by third-party ad networks. By opting out, you ensure your platform does not passively contribute to the behavioral profiling of your visitors.
2. Preventing Data Leakage
If your website deals with sensitive topics (e.g., a healthcare portal, a financial advice forum, or a mental health support site), participating in FLoC could leak the fact that a user visits such sites. The cohort ID, while representing a group, still reflects the types of sites the user frequents.
3. Mitigating Fingerprinting Vectors
Security engineers are constantly battling browser fingerprinting. By explicitly disabling interest-cohort, you remove the document.interestCohort() API from the execution context of your web pages. This neutralizes the ability of malicious scripts or aggressive trackers to extract the cohort ID.
4. Regulatory Compliance
Under stringent privacy frameworks like the General Data Protection Regulation (GDPR) and the California Consumer Privacy Act (CCPA), processing user data for profiling without explicit consent is legally precarious. Opting out of FLoC by default aligns your infrastructure with the principle of "Data Protection by Design and by Default."
Understanding the Permissions-Policy Header
The Permissions-Policy HTTP header (formerly known as Feature-Policy) allows web developers to selectively enable, disable, and modify the behavior of certain APIs and web features in the browser.
It provides a structured mechanism to declare a strong security and privacy posture.
Syntax and Structure
The header is composed of a directive (the feature you want to control) and an allowlist (the origins permitted to use the feature).
Permissions-Policy: <directive>=<allowlist>
To block a feature entirely, you use the empty allowlist ().
The interest-cohort Directive
To opt a site out of FLoC, the specific directive used is interest-cohort.
Therefore, the complete header payload required is:
HTTP/1.1 200 OK
Content-Type: text/html; charset=UTF-8
Permissions-Policy: interest-cohort=()
X-Content-Type-Options: nosniff
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
This header instructs the browser: "Do not include this site's URL in the calculation of the user's FLoC cohort, and do not allow JavaScript on this site to access the FLoC API."
Technical Deep Dive: Implementing the Permissions-Policy Header
Implementing the Permissions-Policy header to block FLoC requires modifying your server configuration or application logic. Below are exhaustive guides for the most common web servers and application stacks.
1. Apache HTTP Server
Apache administrators can easily inject the header using the mod_headers module.
First, ensure the module is enabled:
$ sudo a2enmod headers
$ sudo systemctl restart apache2
Next, add the following directive to your httpd.conf, apache2.conf, or within the <VirtualHost> block of your specific site, or even in a .htaccess file:
<IfModule mod_headers.c>
# Opt out of FLoC cohort calculation
Header always set Permissions-Policy "interest-cohort=()"
</IfModule>
Why always?
Using always ensures the header is attached to all responses, including error pages (like 404s or 500s), preventing any edge-case tracking.
2. Nginx
For Nginx, you will utilize the add_header directive. This should be placed within your server or location block.
server {
listen 443 ssl http2;
server_name www.example.com;
# Other SSL and server configs...
# Opt out of FLoC
add_header Permissions-Policy "interest-cohort=()" always;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
}
Security Note: Be mindful that in Nginx, an add_header directive within a location block will override all add_header directives inherited from parent blocks. If you define headers at the server level, you must redeclare them in location blocks if you add new headers there.
3. Node.js (Express Framework)
If you are running a Node.js application, particularly with Express, you can set the header via middleware.
const express = require('express');
const app = express();
// Global middleware to set the Privacy Header
app.use((req, res, next) => {
res.setHeader('Permissions-Policy', 'interest-cohort=()');
next();
});
// Using Helmet.js (Recommended)
const helmet = require('helmet');
app.use(helmet());
// Helmet does not set interest-cohort by default, so you must add it custom:
app.use(helmet.permittedCrossDomainPolicies());
app.use((req, res, next) => {
res.setHeader('Permissions-Policy', 'interest-cohort=()');
next();
});
app.get('/', (req, res) => {
res.send('Privacy First Application');
});
app.listen(3000, () => console.log('Server running on port 3000'));
4. Microsoft IIS
For Windows Server environments running Internet Information Services (IIS), you can configure the header via the web.config file located at the root of your application.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<httpProtocol>
<customHeaders>
<!-- Remove it just in case it exists -->
<remove name="Permissions-Policy" />
<!-- Set the header to block FLoC -->
<add name="Permissions-Policy" value="interest-cohort=()" />
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration>
5. Cloudflare Workers / CDNs
If you are using a Content Delivery Network (CDN) like Cloudflare, the most robust way to inject headers globally is through Edge Computing, such as Cloudflare Workers, or via their Rules interface.
Cloudflare Worker Example:
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
async function handleRequest(request) {
// Fetch the original response
let response = await fetch(request)
// Create a new response to allow header modification
let newResponse = new Response(response.body, response)
// Inject the Permissions-Policy header
newResponse.headers.set('Permissions-Policy', 'interest-cohort=()')
return newResponse
}
Alternatively, you can use Cloudflare's Transform Rules (Modify Response Header) in the dashboard without writing code.
Combining Permissions-Policy Directives
In the real world, you rarely serve just the interest-cohort directive. The Permissions-Policy header is highly extensible and should be used to lock down various high-risk browser features like geolocation, camera, and microphone.
If you need to define multiple directives, separate them with a comma.
HTTP/2 200 OK
Permissions-Policy: interest-cohort=(), geolocation=(self), microphone=(), camera=()
Important Syntax Note:
Unlike its predecessor, Feature-Policy, which used spaces to separate origins and semicolons for directives, Permissions-Policy uses structured field values. Directives are separated by commas, and allowlists are enclosed in parentheses.
Verifying Your Header Implementation
Once you have deployed the configuration changes, you must verify that the web server is correctly emitting the header. A Security Engineer should never trust a configuration without empirical verification.
Method 1: Using cURL
The quickest way to check response headers from the command line is using curl.
$ curl -I https://www.yourdomain.com
HTTP/2 200
server: nginx/1.18.0
date: Mon, 22 Jun 2026 12:00:00 GMT
content-type: text/html; charset=UTF-8
strict-transport-security: max-age=63072000; includeSubdomains; preload
x-frame-options: DENY
x-content-type-options: nosniff
permissions-policy: interest-cohort=()
Look for the permissions-policy: interest-cohort=() line. If it exists, your site is successfully blocking FLoC.
Method 2: Browser Developer Tools
You can also inspect the network traffic directly within your browser.
URL: https://www.yourdomain.com
Status: 🔒 Secure Connection
---
Network Tab -> Select Domain Request -> Headers Panel:
Response Headers:
Content-Encoding: gzip
Content-Type: text/html; charset=utf-8
Permissions-Policy: interest-cohort=()
X-XSS-Protection: 1; mode=block
- Open Chrome, Firefox, or Edge.
- Press
F12to open Developer Tools. - Navigate to the Network tab.
- Refresh the page.
- Click on the main document request (usually the first item).
- Under the Headers > Response Headers section, look for the
Permissions-Policyentry.
Method 3: Online Security Scanners
Tools like SecurityHeaders.com or Mozilla Observatory will explicitly check for the presence of a robust Permissions-Policy header. Submitting your domain to these scanners provides a comprehensive grading of your overall header posture.
The Evolution of Privacy: Topics API vs. FLoC
It is important for Web Developers to understand the historical context and the current trajectory of Google's Privacy Sandbox.
Due to the overwhelming backlash, Google officially abandoned FLoC in early 2022.
However, the ambition to replace third-party cookies with an alternative targeting mechanism did not die. Google pivoted to the Topics API.
How Topics API Differs from FLoC
- Broader Categories: Instead of micro-cohorts containing thousands of users, the Topics API classifies user behavior into much broader, human-readable categories (e.g., "Fitness," "Travel," "Automotive").
- Local Storage: The browser determines top topics locally and stores them for only three weeks.
- Transparency: Users have more granular visibility into the topics assigned to them and can remove ones they dislike.
Does interest-cohort=() Block Topics API?
No. The interest-cohort directive was specifically designed for FLoC.
To opt out of the new Topics API, you must use a different set of directives within the Permissions-Policy header, specifically browsing-topics.
To maintain the highest level of privacy, SecHead recommends opting out of both legacy FLoC and modern Topics tracking.
Permissions-Policy: interest-cohort=(), browsing-topics=()
By blocking browsing-topics, you instruct the browser not to record the user's visit to your site for the calculation of their weekly advertising topics.
Frequently Asked Questions (FAQ)
1. What does FLoC stand for?
FLoC stands for Federated Learning of Cohorts. It was a privacy sandbox proposal by Google intended to provide a mechanism for interest-based advertising without relying on third-party cookies.
2. Is FLoC currently being used by Google Chrome?
No. Following extensive criticism from the privacy community, Google deprecated the FLoC proposal and replaced it with the Topics API. However, legacy configurations and awareness of cohort-tracking mechanisms remain highly relevant.
3. Why did privacy advocates hate FLoC?
Privacy advocates argued that FLoC enabled browser fingerprinting, made it difficult to opt out globally, and could inadvertently reveal sensitive user data by assigning cohorts based on sensitive site visits.
4. How do I block FLoC on my website?
You can block FLoC by serving the HTTP response header: Permissions-Policy: interest-cohort=().
5. Do I need to block FLoC if my site has no ads?
Yes. Even if your site doesn't serve ads, if a user visits your site, their browser will use that visit to calculate their cohort ID. By opting out, you protect your users' browsing behavior on your specific platform.
6. What happens if I misconfigure the Permissions-Policy header?
If the syntax of the Permissions-Policy header is invalid, the browser will generally ignore the entire header. This results in a fail-open scenario where no features are blocked. Always validate your syntax carefully.
7. Is interest-cohort supported in all browsers?
No. Many browsers, including Firefox, Safari, and Brave, categorically rejected FLoC and explicitly blocked the algorithm at the browser level. The header was primarily relevant for Google Chrome and Chromium-based browsers that intended to implement the feature.
8. What is the difference between Feature-Policy and Permissions-Policy?
Feature-Policy is the deprecated predecessor to Permissions-Policy. The primary difference is the syntax. Feature-Policy used a space-separated syntax (feature 'none'), while Permissions-Policy uses structured field values (feature=()).
9. Can I set the Permissions-Policy header via HTML meta tags?
No. Unlike some headers (like Content-Security-Policy), the Permissions-Policy header cannot currently be delivered via an HTML <meta http-equiv="..."> tag. It must be delivered as an HTTP response header by the server.
10. Does opting out of FLoC impact my SEO rankings?
No. Serving privacy headers like Permissions-Policy has no negative impact on SEO. In fact, demonstrating a strong security and privacy posture can indirectly benefit your site by establishing trust.
11. How do I block the new Topics API?
To block Google's newer Topics API, you append the browsing-topics directive to your policy: Permissions-Policy: interest-cohort=(), browsing-topics=().
12. Should I remove the interest-cohort header now that FLoC is dead?
While FLoC is officially abandoned, leaving the header in place does no harm and acts as a defensive measure against any legacy systems or future reincarnations of cohort-based tracking. Security engineers often leave it as a "defense in depth" mechanism.
13. Does this header protect against Google Analytics tracking?
No. The interest-cohort directive specifically targets cohort calculation at the browser level. It does nothing to block JavaScript-based analytics trackers like Google Analytics or Meta Pixel.
14. What are some other important Permissions-Policy directives?
Other critical directives to lock down include camera=(), microphone=(), geolocation=(), and payment=(). These prevent embedded iframes or malicious scripts from accessing sensitive device hardware.
15. How can users protect themselves from cohort tracking?
Users can protect themselves by using privacy-focused browsers (like Brave or Firefox), installing tracker-blocking extensions (like uBlock Origin), and disabling third-party cookies and Privacy Sandbox features in Chrome's settings.
Conclusion: Embrace Privacy by Default
The saga of FLoC serves as a vital case study in the modern tension between advertising revenue models and user privacy. For Web Developers and Security Engineers, it underscores the necessity of proactively managing HTTP response headers.
By implementing Permissions-Policy: interest-cohort=(), you draw a definitive line in the sand. You declare that your platform will not be leveraged as an algorithmic data point for third-party advertising networks.
At SecHead, we strongly advise integrating comprehensive Privacy Headers into your deployment pipelines. Protect your users, secure your perimeters, and enforce a privacy-by-default architecture.
SEO_METADATA:
Meta_Title: "How to Block FLoC Using the Permissions-Policy Header"
Meta_Description: "Learn how to block Google's FLoC (Federated Learning of Cohorts) using the Permissions-Policy interest-cohort header. Complete guide for Apache, Nginx, and Node.js."
URL_Slug: "block-floc-permissions-policy-interest-cohort"
Target_Keywords:
- Block FLoC
- Permissions-Policy
- interest-cohort
- Privacy Headers
Related Security Guides
Continue your journey into web security with these related, deep-dive articles from the SecHead team:
Related articles
Free tool
Check your own security headers
Instant grade, plain-language explanations, and a full remediation plan - no signup needed.
Scan your site now →