Sub topic 9
Honoring Global Privacy Control and other opt-out preference signals
This chapter assumes you know how cookies, tags, and pixels load on a page. It also assumes you know the difference between a sale and sharing, which earlier chapters cover. No legal background is needed.
What an opt-out preference signal is
An opt-out preference signal is a setting in a browser or extension that tells every site the user visits, "do not sell or share my personal information." The user sets it once instead of clicking an opt-out link on each site.
Global Privacy Control (GPC) is the most common signal. A browser with GPC turned on does two things:
- It sends the HTTP request header
Sec-GPC: 1. - It exposes
navigator.globalPrivacyControlastrueto JavaScript.
Under the CCPA regulations, a business must treat a valid signal as a request to opt out of sale and sharing. The request applies to that browser or device and to any profile linked to it. If you can tie the browser to a known consumer, such as a logged-in account, apply the opt-out to that account too.
Rules that matter in practice
- No verification. You cannot ask the visitor to prove who they are before honoring the signal.
- No friction. Do not force the visitor to confirm the choice or fill in a form. You may show a status message such as "Opt-Out Request Honored."
- Scope. The signal covers sale and sharing. It does not by itself cover the right to limit use of sensitive personal information.
- Conflicts. If a signal conflicts with a setting the visitor chose on your site, follow the signal. You may ask the visitor to confirm a conflicting choice, but you must honor the signal while you wait.
Enforcement has already happened. California's 2022 settlement with Sephora, which included a $1.2 million penalty, cited a failure to process GPC signals.
Detecting the signal on the client
function loadAdTags() {
// Your own function that injects the advertising tags
console.log('Ad tags loaded');
}
// Client side: check the browser's Global Privacy Control setting
if (navigator.globalPrivacyControl === true) {
// Do not load advertising tags that sell or share personal information
console.log('GPC detected: skipping ad and cross-context tracking tags');
} else {
loadAdTags();
}The check must run before any tag fires. A tag that loads first and is blocked afterward has already sent data.
Detecting the signal on the server
Reading the header on the server keeps the decision out of the page's JavaScript. It also lets you suppress server-to-server calls.
const express = require('express');
const app = express();
// Server side (Express): treat the Sec-GPC header as an opt-out request
function gpcMiddleware(req, res, next) {
req.privacyOptOut = req.get('Sec-GPC') === '1';
next();
}
app.use(gpcMiddleware);
app.get('/', (req, res) => {
res.json({ loadAdTags: !req.privacyOptOut });
});
app.listen(3000);Keeping the opt-out in your systems
Skipping a tag on one page view is not enough. Store the opt-out so it persists, then use it downstream.
def build_audience(contacts, opted_out_ids):
"""Return contacts that may be included in an ad audience upload."""
suppressed = set(opted_out_ids)
return [c for c in contacts if c["id"] not in suppressed]
contacts = [{"id": 1, "email": "[email protected]"}, {"id": 2, "email": "[email protected]"}]
print(build_audience(contacts, opted_out_ids=[2]))Common errors
- Honoring GPC only in the banner and still firing tags from a tag manager.
- Ignoring the signal for logged-out visitors because "we don't know who they are."
- Requiring a login or email before applying the opt-out.
- Forgetting server-side and API conversion events that send data to ad platforms.
Beyond California
Other states also require honoring universal opt-out signals. Colorado, Connecticut, and Texas are examples, though the dates and details vary. A single GPC check usually satisfies all of them. A later chapter compares the states.
Exercise
A visitor with GPC enabled browses your site without logging in. Later they log in to their account. What should happen to their opt-out?
Show answer
The signal applies to the browser from the first request, so ad tags must not fire for sale or sharing. After login, you can tie the browser to the known account, so the opt-out should also be applied to that account and its profile. You must not ask the visitor to verify their identity or confirm the choice first.