# How to anonymize Google Analytics?

**URL:** https://meta.discourse.org/t/how-to-anonymize-google-analytics/36152
**Category:** Feature
**Created:** [11월 30, 2015, 11:14오전 UTC](https://meta.discourse.org/t/how-to-anonymize-google-analytics/36152 "2015-11-30T11:14:44Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![yeapea](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/yeapea/32/122080_2.png) [@yeapea](https://meta.discourse.org/u/yeapea)
#### Post date: [11월 30, 2015, 11:14오전 UTC](https://meta.discourse.org/t/how-to-anonymize-google-analytics/36152/1 "2015-11-30T11:14:44Z")

</div>

Hello,

we need to anonymize IPs in Germany for using Google Analytics. How I can activate this in admin settings?

For GA universal code:

`ga('create', 'UA-XXXXXXX-X', 'website.de'); ga('set', 'anonymizeIp', true); ga('send', 'pageview');`

For classic GA code:

`_gaq.push(['_setAccount', 'UA-XXXXXXX-X']); _gaq.push(['_gat._anonymizeIp']); _gaq.push(['_trackPageview']);`

Best regards

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [12월 1, 2015, 4:19오전 UTC](https://meta.discourse.org/t/how-to-anonymize-google-analytics/36152/2 "2015-12-01T04:19:26Z")

</div>

Paste in whatever custom Analytics JavaScript you need in Admin, Customize, HTML. Do not enable the included Analytics settings if you do that as it will conflict.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [12월 1, 2015, 4:29오전 UTC](https://meta.discourse.org/t/how-to-anonymize-google-analytics/36152/3 "2015-12-01T04:29:40Z")

</div>

A tiny bit trickier, you need to follow this pattern:

> [@Matomo Analytics](https://meta.discourse.org/t/how-to-enable-piwik-analytics-on-discourse/33090):
>
> discourse2Summary Matomo Analytics is a script to enable Matomo analytics on Discourse.hammer_and_wrenchRepository Link [https://github.com/discourse/discourse-matomo-analytics](https://github.com/discourse/discourse-matomo-analytics)open_bookNew to Discourse Themes? [Beginner’s guide to using Discourse Themes](https://meta.discourse.org/t/beginners-guide-to-using-discourse-themes/91966) Install this theme component Features [Matomo](https://matomo.org/) is an open source analytics platform. Users can choose between self-hosting or paying for professional hosting in the cloud. mega Matomo was formerly named Piwik. S…

Notice the `PageTracker` stuff

---

<div class="post-metadata">

### Author: ![chapoi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chapoi/32/537252_2.png) [@chapoi](https://meta.discourse.org/u/chapoi)
#### Post date: [12월 4, 2025, 11:37오전 UTC](https://meta.discourse.org/t/how-to-anonymize-google-analytics/36152/4 "2025-12-04T11:37:09Z")

</div>


