Project

General

Profile

Actions

Support #22595

open

Google Analytics tracking tag not appearing on Puppetry Journal site

Added by scott voth 13 days ago. Updated 13 days ago.

Status:
Testing Required
Priority name:
Normal
Assignee:
Category name:
Analytics
Target version:
-
Start date:
2025-04-21
Due date:
% Done:

0%

Estimated time:
Deployment actions:

Description

Melissa has reported an issue with setting up Google Analytics on https://pirjournal.commons.gc.cuny.edu/

It seems that the Google Tracking ID tag is not appearing, even though she entered it in Settings>>General. She tried activating the MonsterInsights plugin and that didn't help. She deactivated thje plugin but she still sees this error message:

<!-- Note: MonsterInsights is not currently configured on this site. The site owner needs to authenticate with Google Analytics in the MonsterInsights settings panel. -->
<!-- No tracking code set -->
<!-- / Google Analytics by MonsterInsights -->

I set up a test site using the same theme but was unable to recreate the issue. The tracking code appeared when I entered it on Settings>>General. I activated MonsterInsights without setting up tracking code and got the same error. Then I deactivated the plugin and the error message went away.

Not sure what is going on with her site.

Actions #2

Updated by Boone Gorges 13 days ago

  • Status changed from New to Testing Required

When I look at the source code of https://pirjournal.commons.gc.cuny.edu/, I see the Commons-specific GTM code:

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

However, there was a problem where the 'config' flag wasn't being properly set, probably after some changes related to #22082. I've pushed a fix in https://github.com/cuny-academic-commons/cac/commit/c2bf652f97a5187013a98cd7224ac9a7a8504ea3 that addresses this issue.

There may be another issue happening, which is that our Litespeed static page cache is not being flushed when MonsterInsights is activated (and/or the custom GA tag is put into Dashboard > Settings). After making a config change, be sure to navigate to Dashboard > Litespeed Cache > Toolbox, and then 'Purge All' (or 'Purge All - LS Cache'). This should ensure that the necessary markup appears in the page source. See #21833.

Please have the user run another round of tests and let me know whether information is being collected as expected.

Actions

Also available in: Atom PDF