Thanks, Shawn.
The measurement ID is correct in the data streams -> AVForums setting
View attachment 271844
I think like most people, I don't want to get in to the details, but just make it work.
For me the confusing thing is the difference between the property ID and the Measurement ID.
Right, your previous screenshot had a G-2609xxx ID listed in your default XenForo settings. A G-XXXX value is supposed to be a measurement ID in Google Analytics. So I guess my question is where did you get that measurement ID that you manually had to enter there if it's not the measurement ID for the web stream you pulled up (it shows the measurement ID being G-42xxxx, which is the one this add-on used (and seems correct from your screenshots).
I guess it doesn't really matter, but I
am curious where that G-2609xxx measurement ID came from.
The dip in this graph is when better analytics was enabled.
Code:
https://www.avforums.com/admin.php?analytics/charts&uri=https%3A%2F%2Fwww.avforums.com%2F
View attachment 271845
After re-enabling Better Analytics, our reports on Google Analytics have dropped to zero traffic.
As far as why this add-on didn't log data for you even though it was using the right Measurement ID for your web property, my guess is that you were using the option to host the Google Tag Manager JavaScript on your own domain, and that was combined with the fact that your web server is mis-configured. It looks like your web server is intercepting any request that ends in .js without checking if the file actually exists in the file system. So the request for the locally hosted JavaScript (gtm.js) is handled by your web server and it never passes it along to XenForo. You can see an example of this here:
At XenForo, the request for members.js is routed to XenForo application (you see an error from XenForo):
For your site, you don't get an error in XenForo, so the web server is not routing the request to XenForo, and instead handling the request on it's own:
It's not an issue with
any extension in your setup, just .js. Change that same URL to have a random extension (for example .jj), and the web server correctly routes it to XenForo application:
www.avforums.com
So there's a couple things you can do here...
What
I would do is set your web server up to internally handle .js requests
only if the .js file actually exists in the file system (it can't do much if the file doesn't exist). How to configure your web server is probably outside the scope of setting up this add-on, because you've set it up in a non-standard way, but if you are using Nginx, the
try_files
directive is your friend (like if you have a location block handling .js requests, have that block use
try_files
to check if the file exists rather than blindly handling it). Then if the .js file isn't a static file in the file system, it will pass the request along to XenForo (which is the normal action anyway).
The other option is to simply disable the
Host Google Tag Manager JavaScript on your own domain
option. Then nothing is even trying to make the gtm.js request.