[DigitalPoint] Better Google Analytics

[DigitalPoint] Better Google Analytics 1.0.10

No permission to download
You convinced to break out my tools.
I made a google_template and create a template modification to inject that template into the PAGE_CONTAINER.
It should be easier to maintain going forward.
My previous question remain, how do you choose the best template to inject JS code into? Is PAGE_CONTAINER the only choice?
PAGE_CONTAINER probably makes the most sense since it's on every public page (it's why things like Google Analytics code is injected there as well).
 
@digitalpoint

I just spent a bit of time trying to figure out why there were still calls going out to googletagmanager.com with the Host Google Tag Manager JavaScript on your own domain option enabled.

I found two of @Siropu's addons we use (Ads Manager and Custom 404) have templates with <xf:include template="google_analytics" />, which aren't affected by this addon's template modification replacing <xf:include template="google_analytics" /> in PAGE_CONTAINER.

I disabled the default template modification and created a new one, replacing the contents of google_analytics with <xf:include template="ba_google_analytics" />, and now I'm getting a single request.

1679603377434.png

You know way more than I do about this stuff, maybe you have a better way to make this more resilient. I just wanted to post to let you know about a potential issue, and to let others know to inspect their sources to make sure they're not duplicating requests :)
 
I probably wouldn't replace google_analytics template like that... then you have the potential of having ba_google_analytics added twice.

Not sure what would cause what you are seeing, but custom styles and/or other addons doing something funky are most likely the culprit. If you want to go down the road of figuring out what it is, you may want to set it back to the way it was when it's doing the double requests, and slowly disable other add-ons one by one until it stops doing it. Then at least you know which add-on to look deeper into.
 
I probably wouldn't replace google_analytics template like that... then you have the potential of having ba_google_analytics added twice.

Not sure what would cause what you are seeing, but custom styles and/or other addons doing something funky are most likely the culprit. If you want to go down the road of figuring out what it is, you may want to set it back to the way it was when it's doing the double requests, and slowly disable other add-ons one by one until it stops doing it. Then at least you know which add-on to look deeper into.

Good point! I'll figure out something else :)
 
As long as you have the option to track Node in your addon settings, then yes, that can be applied to any GA4 report. If you pull up a report in GA4, the Add comparison operator is the simplest way to do it. For example the orange line is just Node ID 4.

View attachment 283360
Thanks, that's awesome. My ad ops team have a further question. Is it possible to see the aggregated data for whole categories rather than adding up all the subforums?
 
Just curious... Anyone else getting:

Code:
Uncaught TypeError: Cannot read properties of undefined (reading 'prototype')

In Client-side errors panel? I assume this could be related to addons I have.

Did you figure this out? I'm able to reproduce the error with the latest version of Chrome. Only seeing the console error when visiting while logged out. Line 6 of core-compiled.js.
 
Odd. I'll leaving this here for reference.

1679673413354.webp

Code:
core-compiled.js?_v=2b87b89c:6 Uncaught TypeError: Cannot read properties of undefined (reading 'prototype')
    at XF.activate.XF.extend (core-compiled.js?_v=2b87b89c:6:6112)
    at wrap-text-patch.min.js?_v=2b87b89c:4:55
    at wrap-text-patch.min.js?_v=2b87b89c:5:84
 
Thanks, that's awesome. My ad ops team have a further question. Is it possible to see the aggregated data for whole categories rather than adding up all the subforums?
You can use the same comparison system to do more advanced selections... for example you could in fact select multiple nodes to be aggregated to a single value. You won't be able to just pick a forum from a drop-down and have it automatically generate it, so you still would need to pick the node IDs you care about. For example, node ID 4 and 6:

1679674757105.webp

Odd. I'll leaving this here for reference.

View attachment 283498

Code:
core-compiled.js?_v=2b87b89c:6 Uncaught TypeError: Cannot read properties of undefined (reading 'prototype')
    at XF.activate.XF.extend (core-compiled.js?_v=2b87b89c:6:6112)
    at wrap-text-patch.min.js?_v=2b87b89c:4:55
    at wrap-text-patch.min.js?_v=2b87b89c:5:84
No idea what wrap-text-patch is, but it's not part of this addon, and in fact it's not even part of XenForo. So you'll want to figure out where it's coming from and go from there.
 
Dumb question, but do you need to remove your Google Analytics code from the default Xenforo location to use this? I noticed mine still has the old version code in there. Do I need to set that to the G4 version as well, or remove it completely?
 
You don’t need to do anything like that. Do you have an example URL that the page source shows the old code still there?
 
You don’t need to do anything like that. Do you have an example URL that the page source shows the old code still there?
Just in your ACP> SEO(search engine optimization)> Google Analytics web property ID:> Mine still has my old UA-mixed number code in it here. I didn't know if I need to remove it completely or put my G- code here as well. I assume your add-on just ignores the default XenForo location?
 
I recently installed the Font Awesome add-on and also as you know moved to Cloudflare. I seemed to have lost your icon in the upper right. Which one is it if I need to manually add to the font awesome list?

ga-icon.webp
 
Top Bottom