GTM/GA - universal analytics error (debug not working, followed guide)

Hi,

I tried to use the GTM guide to track Universal Analytics on our forum. We have previously used the standard GA function. This has worked previously (though it only appears to work for users who are logged in).

I am an experienced GTM user (though admittedly far from an expert) and I followed the guide for setting up with Google Tag Manager [Setup Google Tag Manager for Analytics]. See below:

Initially, I was able to track traffic from GTM, but within a few minutes the tracking stopped. I gave a day to wait and see if any other traffic was recorded, but there was not.

To test whether this was a fault with GA or GTM, I created a new GA property with no filters but still no traffic appeared. Additionally, despite updating the security settings, I could not get Tag Manager’s debugging tool to work. The window would launch, but no matter how long I left it to load it would remain a blank window at the bottom of my screen.

Since I returned tracking to the GA setup, traffic has resumed, but still there is no traffic from users who are not logged in.

Please could you explain what the issue appears to be and how to fix it.

Thanks,

Nick

1 Like

Are you seeing a Refused to execute inline script error in your browser’s console? If so, adding 'unsafe-inline to your content security policy script src setting should fix the issue. Here how that setting is configured on my test site:

The GTM debugging tool is working on my site.

3 Likes

Hi Simon, thanks for your reply.

I tried this initially and it made no difference, so I decide I would send it off as a question to a developer. Then, before sending it off I tried it again and it worked, so I guess the system just needed some time to process the changes. Thank you for your advice, it worked!

The good news is that I was able to get the the preview window working in Tag Manager and from that determine that the tags were set up correctly to pass data to Google Analytics. On the Google Analytics front, it turns out that the view I was monitoring (set-up before I arrived at the organisation) is a User ID report and that was why no real time picked up no traffic.

This leads me onto the next question. I see that you have set up the user ID function for Google Analytics. [Googe Analytics User-ID feature]. This clearly works to some extend since data is passed through to our User ID report view when using the standard Google Analytics implementation.

However, since switching using universal analytics through Google Tag Manager, this view no longer receives any data. I know the data is being sent through because I can see it in a non-User ID report view. In theory, this should not be an issue as the User ID appears appears to be included in the Tag Manager code implemented in the HTML, but the Analytics view refuses to recognise any User ID data.

I therefore followed the steps necessary to configure Universal Analytics User ID through Tag Manager [The Google Analytics user ID - Tag Manager Help]. Still nothing. Do you have any suggestions to fix this?

Finally, and more importantly, I switched this account from being run by Analytics to Tag Manager because I was hoping to track user interactions on a much greater level. For example, on our main site we track every type of link click and interaction. If I click anywhere in preview mode on discourse, no clicks, link clicks, form submissions etc are tracked.

All the relevant variables for these events to occur are turned on, so I can only assume there is an error on Discourse’s end; am I mistaken?

Without these events firing, I cannot build triggers to fire tags and collect event data. Can you advise me of what to do?

Thanks again,

Nick

Hi @NickSS

Did you get anywhere with tracking link clicks? We’re trying to set up analytics to track document downloads and external links and I have run into the same issue with click events not firing.

Cheers
Katie

We were able to resolve our issue with “link clicks” by updating the GTM trigger to be “click - all elements” - the “just links” trigger wouldn’t fire, but the all elements one would.

2 Likes