Cookie Consent and Google Analytics

Hello,

I have a question about cookie consent and Google Analytics for my client’s Shopify store.

We use a cookie consent banner. But when visitors click “accept”, sometimes Google Analytics does not track their visit. Some conversions or page views are missing.

Is this a common problem with Shopify? Should I change any settings in the theme or the consent app? Do I need to set up Google Consent Mode, or check Google Tag Manager?

What is the best way to make sure Google Analytics tracks only after visitors accept cookies, and works well?

Thank you for any help!

you are absolutely right. setting up the consent mode is important. it helps you to communicate user cookies consent status to google. and based on the same, the tag (or pixels) will adjust their behavior so that they respect the user’s choice.

also, as you might be doing this for your shopify store, technically this may get a bit challenging.

as an alternative, go with a Google Ads conversion pixel app like Nabu for Google Ads pixel. allows you implement google tags with just a few clicks, supports visitor consent tracking, and provides accurate conversion tracking for all major events.

Some people block tracking with browser or any extension like adblocker.

Dificult to say what actually happen on your store without testing.

This issue is typically caused by tag sequencing under Consent Mode v2.

Your GA4 tag is likely firing before the consent banner updates the analytics storage setting.

To fix it:

  • Fire GA4 on Consent Initialization.

  • Set analytics storage to ‘denied’** by default.

  • Send a consent update once cookies are accepted.

I ran an audit of my GA4 setup with GAfix.ai and found my tag firing sequence was slightly off. Once corrected, the reporting recovered immediately. You can use any audit tool to check tag timing and consent signals. It saves a lot of manual debugging.

this is almost always a tag firing sequence issue. your GA4 tag is probably loading before the consent banner updates the analytics_storage signal, so it runs in denied mode even after the user clicks accept.

the fix is making sure GA4 fires on a consent update trigger (not page load) so it picks up the “granted” state. if you’re using shopify’s built-in privacy API, listen for the visitorConsentCollected event before initializing your tags.