Most stores install Google Analytics on day one and forget about consent. Here is a clean setup.
1. Hold the code until consent
Paste the Analytics snippet in your consent tool, in the audience measurement category, instead of the theme header.
2. Turn on Consent Mode v2
Google tags receive “denied” by default, then “granted” if the visitor accepts.
3. Do the same for pixels
Meta, TikTok or Pinterest pixels go in the marketing category.
4. Add a link to change the choice
In the footer, next to the privacy policy.
5. Update your privacy policy
List the tools you use and why.
Read what a good cookie banner does.
Cookiely runs your Analytics code only after consent and sends Consent Mode v2. See it on the demo.
Frequently asked questions
Can Google Analytics run before consent?
In the EU, analytics cookies generally require consent; hold the code until the visitor accepts.
What is Consent Mode v2?
A Google signal that tells its tags whether they may use cookies for analytics and ads.
Where do I put the Analytics code?
In the consent tool’s audience measurement category.