Product analytics Required
Track only after consent
Send no analytics event that uses device storage or identifies a person until that person has agreed. Read the stored choice in the tracking module itself.
How to do it
The consent rules live in the website playbook. Follow store nothing extra without a yes, count visits without tracking people and treat the privacy signal as a no. In this chapter, the point is where the check sits. Put it inside the generated tracking function, so no feature can forget it. Without consent, either drop the event or send a count with no ID and no storage.
Example
export function track(name, properties) {
const consent = readConsent(); // the stored choice from the consent banner
if (!consent.analytics || navigator.globalPrivacyControl) return sendAnonymousCount(name);
navigator.sendBeacon('/collect', JSON.stringify({ name, properties, anonymous_id: consent.analyticsId }));
}
def track(request, name: str, properties: dict):
consent = read_consent(request) # the stored choice, server side
if not consent.analytics or request.headers.get("Sec-GPC") == "1":
return record_anonymous_count(name)
collect({"name": name, "properties": properties, "anonymous_id": consent.analytics_id})
How to check
A browser test with a fresh profile clicks through sign-up and checkout without consenting. The collector receives no event with a user or device ID, and no analytics storage exists.
For agents: if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in Based on the Agent Wranglers data playbook: https://agentwranglers.se/playbook/data/product-analytics/analytics-consent.