How can I successfully implement Google Analytics IP anonymization?

AI-generated summary

Google Analytics IP anonymization in Shopify is the main issue. The question asks where to place ga('set', 'anonymizeIp', true); so that Google Analytics sends anonymized IPs (aip=1), and whether deleting the GA tracking code from Shopify preferences also removes any code added in Liquid templates.

Key points raised:

  • The suggested placement was between ga('create', ...) and ga('send', 'pageview');, but the poster could not find that code in Shopify.
  • A possible concern mentioned is that related Google/Shopify integrations may make the setup harder to locate.
  • The concrete answer given is to add ga('set', 'anonymizeIp', true); in Shopify’s Additional Google Analytics Javascript section.

Current outcome:

  • A practical implementation step was provided: adding the code in the Additional Google Analytics Javascript area should anonymize all GA collect requests.
  • The follow-up question about whether deleting the GA code from preferences also removes code from Liquid was not answered, so that part remains unresolved.

Good Day I need help with the IP anonymization.

As suggested I need to to the following: ga(‘set’, ‘anonymizeIp’, true);

But this is not working at all.

I was suggested by Google to put this code in between of:

ga(‘create’, ‘UA ------’, ‘auto’);

→ ga(‘set’, ‘anonymizeIp’, true);

ga(‘send’, ‘page view’);

→ Apparently : https://pay.google.com makes this issues

I am not able to find where this code is embedded into shopify, may someone assist?

Secondly, when I delete the GA Code from preferences, do code still remain in liquid or will it be deleted?

Thank you

No-One?

Add the following to your Additional Google Analytics Javascript section and all collect requests will use the aip=1 parameter, a.k.a. anonymized IP addresses.

ga('set', 'anonymizeIp', true);