[DigitalPoint] Better Google Analytics

[DigitalPoint] Better Google Analytics 1.0.11.1

No permission to download
Clicking on City on Dimension on the Graphs page sometimes generated this error. Other times, it shows a blank graph.
Code:
InvalidArgumentException: Please remove city to make the request compatible. The request's dimensions & metrics are incompatible. To learn more, see https://ga-dev-tools.web.app/ga4/dimensions-metrics-explorer/ in src/addons/DigitalPoint/Analytics/GoogleApi/AbstractApi.php at line 31

[*]DigitalPoint\Analytics\GoogleApi\AbstractApi->makeApiCall() in src/addons/DigitalPoint/Analytics/GoogleApi/Data.php at line 14
[*]DigitalPoint\Analytics\GoogleApi\Data->runReport() in src/addons/DigitalPoint/Analytics/Repository/Reporting.php at line 159
[*]DigitalPoint\Analytics\Repository\Reporting->runReport() in src/addons/DigitalPoint/Analytics/Repository/Reporting.php at line 284
[*]DigitalPoint\Analytics\Repository\Reporting->getChart() in src/addons/DigitalPoint/Analytics/Admin/Controller/Analytics.php at line 85
[*]DigitalPoint\Analytics\Admin\Controller\Analytics->actionCharts() in src/XF/Mvc/Dispatcher.php at line 352
[*]XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 258
[*]XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 115
[*]XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 57
[*]XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2483
[*]XF\App->run() in src/XF.php at line 524
[*]XF::runApp() in admin.php at line 13
 
I get a lot of these errors when clicking on the options for reports. Is there something that I need to enable?

error.webp
 
Is it a new property by chance? Have seen a couple people get something similar, but I haven’t been able to replicate it on my end.
 
Is it a new property by chance? Have seen a couple people get something similar, but I haven’t been able to replicate it on my end.
Nope it's not a new property, I set it up last fall. This happens on a few of them when clicking on them. Also, it's strange I know in the description it says you can see topic views etc. I get none of these options. Everything seems to look ok in option. I linked the Google account etc.
 
Which report (and which options) are you using when you get it? Will try again to see if I can replicate it on this end.
The seem to be random the last one I got the error on was 'newusers'. I just went through all and that is the only one doing it right now. Here is something else that I noticed, if I click on the chart through the admin bar I get the error, if I go through admin control panel and then charts it will not give me the error, it's only when I follow the link for the charts on the admin bar. I hope that helps.
 
The seem to be random the last one I got the error on was 'newusers'. I just went through all and that is the only one doing it right now. Here is something else that I noticed, if I click on the chart through the admin bar I get the error, if I go through admin control panel and then charts it will not give me the error, it's only when I follow the link for the charts on the admin bar. I hope that helps.
Ah... ya, that's helpful. Probably why I never was able to replicate it since I was doing it from admin.
 
Okay, I think I got it sorted out. There was a change to the Google API where they disallowed dimensions that include the query string to be used with most other metric/dimensions.

Not that anyone cares to read about the details, but it's here: https://developers.google.com/analy.../announcements/20221201-compatibility-changes
Dimensions that include the query string like pagePathPlusQueryString will only be compatible with a limited set of dimensions & metrics.

So that's what was causing the issue recently when the URI was included (page-specific analytics). I've reduced URI down to just be the page path (omitting query strings) and it's working again for next version.
 
@digitalpoint

I'd like to confirm which JS scripts should be called with these settings.

1680281687027.png 1680281743713.png

I'm asking because we have two sites (dev site and our production site) running what should be the same style and the same settings, but seeing different results. I disabled all ads and other third party scripts while testing.

When I inspect sources for the dev site, the only script called is https://domain.com/jc/gtm.js?_v=d53879d8.

When I inspect the production site, the following is called:
  • https://domain.com/jc/gtm.js?_v=a89903e0
  • https://www.google-analytics.com/analytics.js
  • https://www.googletagmanager.com/gtag/js?id=UA-5782872-7&l=dataLayer&cx=c
 
Last edited:
Looks to me like your production site is a "Universal Analytics" property, not a Google Analytics 4 property (Universal Analytics is pre-GA4). That fact that your production site has a Analytics property that starts with UA- means it's "Universal Analytics". Basically a completely different version of Google Analytics (GA4 is replacing UA). This addon does not work with UA, only GA4.

FYI, Universal Analytics is completely going away in a few months:


To answer your question, if you are using this addon with the option to host the JavaScript on your own domain, the gtm.js should be the only script it calls.
 
Looks to me like your production site is a "Universal Analytics" property, not a Google Analytics 4 property (Universal Analytics is pre-GA4). That fact that your production site has a Analytics property that starts with UA- means it's "Universal Analytics". Basically a completely different version of Google Analytics (GA4 is replacing UA). This addon does not work with UA, only GA4.

FYI, Universal Analytics is completely going away in a few months:


To answer your question, if you are using this addon with the option to host the JavaScript on your own domain, the gtm.js should be the only script it calls.

Good catch! The production site has the old UA property linked to the new GA4 property, so I bet it's using GTM to load the UA JS. The dev site is GA4 only.

Thanks for looking into it (y)
 
There is a conflict with another addon (Impersonate User) where both inject a link in the moderator bar.
Screenshot 2023-04-02 at 5.18.48 PM.webp

Screenshot 2023-04-02 at 5.20.25 PM.webp
 
Of course.
Code:
/<a href="{{ base_url\('admin\.php'\) }}" class="p-staffBar-link".*<\/xf:if>/isU
What exactly are you seeing? That regex doesn't appear to conflict when I try using it as a template modification (both work fine when I try it).
 
What exactly are you seeing? That regex doesn't appear to conflict when I try using it as a template modification (both work fine when I try it).
It will insert a link just fine. But when you click on that link to log in as another user, it is supposed to display a Revert User link for you to log back out. This Revert User link is gone with Better Analytic addon.
When I disable your's addon template modification to insert the Chart icon in moderator bar, the other addon works properly.

I just want to bring this up in case the issue lies with the other addon because I saw a few mentions of the Logout link disappear when there is another addon that modifies the moderator bar.
 
Back
Top Bottom