# How to enable Google Analytics

**URL:** https://meta.discourse.org/t/how-to-enable-google-analytics/159891
**Category:** Data & reporting
**Tags:** analytics
**Created:** [August 5, 2020, 10:14am UTC](https://meta.discourse.org/t/how-to-enable-google-analytics/159891 "2020-08-05T10:14:20Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Andro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/andro/32/173721_2.png) [@Andro](https://meta.discourse.org/u/Andro)
#### Post date: [August 5, 2020, 10:14am UTC](https://meta.discourse.org/t/how-to-enable-google-analytics/159891/1 "2020-08-05T10:14:20Z")

</div>

I cant see anywhere I can enable setup for Google Analytics. Nor can I find a plugin. So how does one do this in Discourse?

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [August 5, 2020, 4:45pm UTC](https://meta.discourse.org/t/how-to-enable-google-analytics/159891/3 "2020-08-05T16:45:23Z")

</div>

The topic at [Integrate Google Tag Manager with Google Analytics](https://meta.discourse.org/t/setup-google-tag-manager-for-analytics/47335) describes how to setup Google Tag Manager on Discourse. We seem to be missing a #howto topic that deals with just setting up Google Analytics.

If you are not using Google Tag Manager, all you need to do to setup Google Analytics is add your Google Analytics tracking code to the Discourse `ga universal tracking code` site setting, and your domain name to the `ga universal domain name` site setting. When the `ga universal tracking code` site setting is set, Discourse will automatically load the analytics script.

---

<div class="post-metadata">

### Author: ![JimPas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jimpas/32/148179_2.png) [@JimPas](https://meta.discourse.org/u/JimPas)
#### Post date: [August 6, 2020, 2:31am UTC](https://meta.discourse.org/t/how-to-enable-google-analytics/159891/4 "2020-08-06T02:31:17Z")

</div>

@simon  
If you notice in the Solved by it shows “in post #3”. There were only **two** posts in before I posted this. It incorrectly showed “post #3” instead of post 2. Here’s what it’s showing. Feel free to create a topic for this if needed. 🙂

 ![image](https://global.discourse-cdn.com/meta/original/3X/8/e/8e40ab754dd50debc6e2b76e5825c441ff2c258d.png)

---

<div class="post-metadata">

### Author: ![HAWK](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hawk/32/86627_2.png) [@HAWK](https://meta.discourse.org/u/HAWK)
#### Post date: [August 6, 2020, 4:12am UTC](https://meta.discourse.org/t/how-to-enable-google-analytics/159891/5 "2020-08-06T04:12:01Z")

</div>

There was originally another response which was deleted. It looks like we’re not catching that edge case.

---

<div class="post-metadata">

### Author: ![Andro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/andro/32/173721_2.png) [@Andro](https://meta.discourse.org/u/Andro)
#### Post date: [August 6, 2020, 10:05am UTC](https://meta.discourse.org/t/how-to-enable-google-analytics/159891/6 "2020-08-06T10:05:27Z")

</div>

> [@simon](#):
>
> If you are not using Google Tag Manager, all you need to do to setup Google Analytics is add your Google Analytics tracking code to the Discourse `ga universal tracking code` site setting, and your domain name to the `ga universal domain name` site setting. When the `ga universal tracking code` site setting is set, Discourse will automatically load the analytics script.

I’m not using Tag Manager, so this is the answer I was looking for. After entering the data from GA in this fields, nothing happens. What do you have to do next to enable it? I see nothing in the rendered pages source related to GA anywhere.

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [August 6, 2020, 10:44pm UTC](https://meta.discourse.org/t/how-to-enable-google-analytics/159891/7 "2020-08-06T22:44:17Z")

</div>

I have just tested this out on my own site. After adding my analytics Tracking ID to the Discourse `ga universal tracking code` site setting, I am seeing activity from the site on my Analytics page.

If you open your browser’s web inspector to its Console tab on your forum, you may see Content Security Policy violations listed there. If you are seeing errors, can you check to see if `https://www.google-analytics.com` has been added to your Discourse site’s `content security policy script src` setting? That source should be automatically added by Discourse when the universal tracking code is set, but possibly it hasn’t been added on your site.

If you are not seeing any Content Security Policy errors, then the problem may be with your the configuration on your Google Analytics account.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [September 5, 2020, 10:44pm UTC](https://meta.discourse.org/t/how-to-enable-google-analytics/159891/8 "2020-09-05T22:44:19Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
