Consent Mode v2 Snippet Generator

Generate a ready-to-paste snippet that implements Google Consent Mode v2 on your site. Paste it in your <head> before any Google tags (gtag, GTM, or GA4).

Your settings

Verify it's working

After you add the snippet to your site, run a free scan to confirm Consent Mode v2 and tracking behave correctly.

Run free scan →

Official Google Consent Mode documentation →