# "New" Google Analytics connection

**URL:** <https://discourse.openondemand.org/t/new-google-analytics-connection/1295>\
**Category:** Get Help\
**Created:** [January 28, 2021, 6:11pm UTC](https://discourse.openondemand.org/t/new-google-analytics-connection/1295 "2021-01-28T18:11:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcuma](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/mcuma/32/171_2.png) [@mcuma](https://discourse.openondemand.org/u/mcuma)\
**Post date:** [January 28, 2021, 6:11pm UTC](https://discourse.openondemand.org/t/new-google-analytics-connection/1295/1 "2021-01-28T18:11:05Z")

</div>

Hi everyone,

we are putting up a new OOD instance, and I am trying to connect Google Analytics to it. I am following [https://osc.github.io/ood-documentation/latest/analytics/google-analytics.html](https://osc.github.io/ood-documentation/latest/analytics/google-analytics.html), which I have done in the past for our production OOD instance, and which works fine.

But, Google Analytics now has a “new” way of setting this up, now using “Data Streams” inside of the “Property” and I am not able to get the monitoring traffic to get passed from our OOD instance to the GA.

The “old” GA just uses the “Property”.

Though, the gtag.js suggested by GA is essentially the same, e.g, for the “old” one:

> 

and the new one:

> 

In the new instance’s ood-portal.yml, I have:

> analytics:  
> id: ‘G-FJGVXXXXXX’  
> url: ‘[http://www.google-analytics.com/collect](http://www.google-analytics.com/collect)’

I guess my first question is if anyone has done GA recently with the “stream” tracking - which would make me think that perhaps our OOD instance is not able to talk to GA due to some restriction in the route.

Or, if not, how can I troubleshoot this further. I.e. what does OOD do with the config in ood-portal.conf to generate the tracking tag.

Or perhaps we could see the traffic to the GA in the Apache logs somewhere?

Thanks,  
MC

Has anyone done this recently with the “new” GA?

---

<div class="post-metadata">

**Author:** ![efranz](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/efranz/32/27_2.png) [@efranz](https://discourse.openondemand.org/u/efranz)\
**Post date:** [February 15, 2021, 1:41pm UTC](https://discourse.openondemand.org/t/new-google-analytics-connection/1295/2 "2021-02-15T13:41:54Z")

</div>

I opened [New Google Streams is causing problems with analytics collection · Issue #886 · OSC/ondemand · GitHub](https://github.com/OSC/ondemand/issues/886) to track this. We haven’t updated our GA snippet in a while and were not aware of this change.

---

<div class="post-metadata">

**Author:** ![mcuma](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/mcuma/32/171_2.png) [@mcuma](https://discourse.openondemand.org/u/mcuma)\
**Post date:** [February 15, 2021, 4:44pm UTC](https://discourse.openondemand.org/t/new-google-analytics-connection/1295/3 "2021-02-15T16:44:47Z")

</div>

Thanks Eric, looking forward to hearing what you find out.

Here are the gtag.js files that are visible. First the “old” GA on our production instance:

```
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-XXXXXXXX-1"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'UA-xxxxxxxxx-1');
</script>

```

And now the “new” one:

```
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-FJGVXXXXXX"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'G-FJGVXXXXXX');
</script>

```

As you can see, they are pretty much the same.

---

<div class="post-metadata">

**Author:** ![westburg.2](https://avatars.discourse-cdn.com/v4/letter/w/0ea827/32.png) [@westburg.2](https://discourse.openondemand.org/u/westburg.2)\
**Post date:** [May 26, 2022, 3:42pm UTC](https://discourse.openondemand.org/t/new-google-analytics-connection/1295/4 "2022-05-26T15:42:59Z")

</div>


