Integrations
Google Analytics 4Google Analytics 4
preset documentationDocumentation

CookiePilot GA4 preset: analytics_storage, _ga and pre-consent testing

Set Google Analytics 4 as analytics and start measurement only after consent. CookiePilot keeps analytics_storage denied before the user's choice and helps separate cookieless pings from tracking cookies.

Consent behaviour

Category: analytics.

Consent Mode: analytics_storage denied before consent.

Google cookieless pings with denied are not the same as tracking cookies.

Setup steps

Make the GA4 tag consent-aware in GTM or gtag.

Do not write _ga before analytics granted.

After Accept, check g/collect and the dataLayer update.

Example snippet

Example snippet
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-XXXXXXXXXX', {
  anonymize_ip: true
});
</script>

Test checklist

No _ga before consent.

gcd shows analytics denied.

After Accept, analytics is granted.

Conversion events are not duplicated in GTM.

Related integrations

See the setups that most often appear together with this integration.

Ready to configure it?

Start CookiePilot, choose the right integration and verify that tags wait for user consent before they run.