[DigitalPoint] Better Google Analytics

[DigitalPoint] Better Google Analytics 1.0.10

No permission to download
Does this addon provide any graphs or charts within xenForo, if so, where do I find them?
 
Received two errors in the admincp that I believe may be attributed to this addon - thought I'd paste for reference. I've not noticed any particular issues personally.

  • Error: Call to a member function getBody() on null
  • src/addons/DigitalPoint/Analytics/Repository/JavaScript.php:53
  • Generated by: Unknown account
  • Jun 9, 2022 at 12:58 PM

Stack trace​

#0 src/addons/DigitalPoint/Analytics/Cron/CleanUp.php(24): DigitalPoint\Analytics\Repository\JavaScript->getFile('gtm', true)
#1 src/XF/Job/Cron.php(37): DigitalPoint\Analytics\Cron\CleanUp::runHourlyCleanUp(Object(XF\Entity\CronEntry))
#2 src/XF/Job/Manager.php(260): XF\Job\Cron->run(7.72755)
#3 src/XF/Job/Manager.php(202): XF\Job\Manager->runJobInternal(Array, 7.72755)
#4 src/XF/Job/Manager.php(86): XF\Job\Manager->runJobEntry(Array, 7.72755)
#5 job.php(43): XF\Job\Manager->runQueue(false, 8)
#6 {main}

Request state​

array(4) {
["url"] => string(8) "/job.php"
["referrer"] => string(32) "https://www.behind-the-mask.net/"
["_GET"] => array(0) {
}
["_POST"] => array(0) {
}
}

  • ErrorException: Server was too slow.
  • src/XF/Error.php:77
  • Generated by: Unknown account
  • Jun 9, 2022 at 8:58 PM

Stack trace​

#0 src/XF.php(219): XF\Error->logError(Object(XF\Phrase), false)
#1 src/addons/DigitalPoint/Analytics/Repository/JavaScript.php(50): XF::logError(Object(XF\Phrase))
#2 src/addons/DigitalPoint/Analytics/Cron/CleanUp.php(24): DigitalPoint\Analytics\Repository\JavaScript->getFile('gtm', true)
#3 src/XF/Job/Cron.php(37): DigitalPoint\Analytics\Cron\CleanUp::runHourlyCleanUp(Object(XF\Entity\CronEntry))
#4 src/XF/Job/Manager.php(260): XF\Job\Cron->run(7.90474)
#5 src/XF/Job/Manager.php(202): XF\Job\Manager->runJobInternal(Array, 7.90474)
#6 src/XF/Job/Manager.php(86): XF\Job\Manager->runJobEntry(Array, 7.90474)
#7 job.php(43): XF\Job\Manager->runQueue(false, 8)
#8 {main}

Request state​

array(4) {
["url"] => string(8) "/job.php"
["referrer"] => string(38) "https://www.behind-the-mask.net/media/"
["_GET"] => array(0) {
}
["_POST"] => array(0) {
}
 
Found the charts and graphs, but struggling to locate the real time data :D
The realtime data you can get from Google Analytics is pretty limited (you can't even see the URL of a real-time page view for example). So for the purposes of this add-on, the realtime data is presented in a block on the admin main index page as a world map.


Received two errors in the admincp that I believe may be attributed to this addon - thought I'd paste for reference. I've not noticed any particular issues personally.
Is it consistent, like happening every hour (when the cron runs), or was it transient? That exception is the standard exception from when the XenForo Http client times out when the http request fails. So if Google's server takes too long to respond to the http request, that would be the normal expected exception that gets logged. The timeout in this case would happen if Google's server doesn't respond to the http request after 8 seconds. The http request being this: https://www.googletagmanager.com/gtag/js

If it's something you are seeing on a consistent basis, it might be worth doing a trace route from your server to www.googletagmanager.com, or just try fetching that URL from your server with something like curl or wget to try and sort out what's going on. If it's not happening on a consistent basis, it's going to be tough to try and debug without being able to go back in time to when it was happening (could be as simple as bad network route that has already been fixed.
 
Last edited:
1. I connected my Google account and somehow it didn't find the existing property I am using for years now. So I created a new one.

Now in Google I have the old and the new one. What is the recommended way here? Should I go with a new property or use the old one?

2. Where and when do we the new stats? Under admin.php?stats/ I don't see any new criteria.

3. When we uninstall the addon, does it all go back to its normal way? Does the old Google Analytics property still track everything?

4. When I connected the Google account, it asked for authorization. Do you get access to our data?

5. Thank you :).
 
1. I connected my Google account and somehow it didn't find the existing property I am using for years now. So I created a new one.

Now in Google I have the old and the new one. What is the recommended way here? Should I go with a new property or use the old one?

You likely were using Google Universal Analytics (otherwise known as GA3). This add-on is for GA4. To use this add-on you must have a GA4 property setup, which is likely what you did when you set up a new one.


2. Where and when do we the new stats? Under admin.php?stats/ I don't see any new criteria.

The new GA4 property you setup will likely not show data for a day or two, this is normal. You will see statistics within this add-on, and on Google within a day or two.


3. When we uninstall the addon, does it all go back to its normal way? Does the old Google Analytics property still track everything?

With this add-on enabled you will not be getting statistics sent to your old Universal Analytics (GA3) property. This add-on will overwrite that code when enabled. When this add-on is disabled or removed, your Universal Analytics (GA3) property will again start receiving data but you will have missing data from when the add-on was enabled (you will need to look at your GA4 property to see it). It is recommended to stop using GA3 once you start using GA4 - so issues like this don't come up. GA3 will stop processing data completely on July 1, 2023.


4. When I connected the Google account, it asked for authorization. Do you get access to our data?

The author of this add-on has no access to your data.
 
  • Love
Reactions: sbj
Thanks.

Is there a way to migrate my existing GA3 to GA4 then? So I don't lose years of my data?
 
1. I connected my Google account and somehow it didn't find the existing property I am using for years now. So I created a new one.

Now in Google I have the old and the new one. What is the recommended way here? Should I go with a new property or use the old one?

2. Where and when do we the new stats? Under admin.php?stats/ I don't see any new criteria.

3. When we uninstall the addon, does it all go back to its normal way? Does the old Google Analytics property still track everything?

4. When I connected the Google account, it asked for authorization. Do you get access to our data?

5. Thank you :).
1. That’s normal… Google Analytics 4 properties are different than legacy and Universal Analytics properties.

2. Reports are under Admin -> Logs -> Analytics (the Logs area is also where XF has its stats).

3. Yes, it goes back to as if you never installed it.

4. No, your OAuth2 credentials are stored in your XenForo install, not on my end.

5. Yep. 🙃
 
  • Love
Reactions: sbj
Thanks.

Is there a way to migrate my existing GA3 to GA4 then? So I don't lose years of my data?
No… Google has set a date next summer that old properties will stop processing data and GA4 is a new event based model/system. Basically you can choose to migrate now, or be forced to migrate next year. I’m not aware of any system out there that will import old Analytics data into a GA4 property. There might be one, but it also seems like a waste of time because GA4 doesn’t keep data indefinitely like the old properties. So your old imported data would be wiped on a rolling window anyway.
 
  • Love
Reactions: sbj
Reports are under Admin -> Logs -> Analytics (the Logs area is also where XF has its stats).
Ah, damn, I need glasses. I expected it to be under statistics, but you created a new whole section just below it, which I missed.


So your old imported data would be wiped on a rolling window anyway.
I see. Strange that there is no tool to just upgrade GA3 to GA4 but if there is none, so be it. Good to know that I made the right decision to use this addon since otherwise next year I would have started with GA4 and would have wasted a whole year with no data.
 
I see. Strange that there is no tool to just upgrade GA3 to GA4 but if there is none, so be it. Good to know that I made the right decision to use this addon since otherwise next year I would have started with GA4 and would have wasted a whole year with no data.
Ya, it's definitely not ideal. It would have been nice if Google made a tool to migrate data, but I can also see the benefit of not doing it because then they would need to make compromises of how GA4 handles data (they made a cut and completely changed the model to be totally event driven so it's quite different internally vs. the previous version which they were able to carry over between versions).

Basically it was internally a complete rewrite and different way of thinking (it's designed for not just websites, but also apps or call centers, and done in a way that privacy is taken into account with today's policies). It's a good foundation for going beyond just website tracking... which is why the old properties aren't compatible with the new ones unfortunately.
 
  • Like
Reactions: sbj
digitalpoint updated [DigitalPoint] Better Google Analytics with a new update entry:

Minor tweaks

  • Changed "javascript" route to "jc" to avoid conflict with web servers configured to internally handle requests with the string "javascript" without passing it along to XenForo (only applies when using the Host Google Tag Manager JavaScript on your own domain option)
  • Made the realtime block on admin index collapsible
  • Reports and realtime block have a link at top to take you directly to Google Analytics

Read the rest of this update entry...
 
Updated and re-enabled the hosted JS and it seems to be fine now. Thx for the update. The G that takes you to Analytics is nice but as a developer my opinion is it's not discoverable. I like how some of my device sites do it with a button "Open in Analytics" so you are very clear to the user that it's there. My $.02.

Nice job.
 
I spoke too soon. Daily Statistics is dead. No data.

Disregard. I see it was for the specific page I was viewing. It would be nice if there was a way to clear the set URL and return to the home page to view stats? I used the Stats button at the top right of the site when I was on a page, a page I didn't care about but just wanted to go into Stats to view.
 
Updated and re-enabled the hosted JS and it seems to be fine now. Thx for the update. The G that takes you to Analytics is nice but as a developer my opinion is it's not discoverable. I like how some of my device sites do it with a button "Open in Analytics" so you are very clear to the user that it's there. My $.02.

Nice job.
The first version was kind of like how you are talking about. The problem is there’s limited room on mobile devices. So the option was either to make it smaller or do something different depending on the device you are on. I went with consistency across devices.

7817A51A-58AE-4728-BCB5-C34B622606AE.jpeg
I spoke too soon. Daily Statistics is dead. No data.

Disregard. I see it was for the specific page I was viewing. It would be nice if there was a way to clear the set URL and return to the home page to view stats? I used the Stats button at the top right of the site when I was on a page, a page I didn't care about but just wanted to go into Stats to view.
Ya, it's been in the back of my mind that I want to make it an option where people can just "x" out the url when they are there, similar to here:


...I just haven't gotten around to doing it yet.
 
I spoke too soon. Daily Statistics is dead. No data.

Disregard. I see it was for the specific page I was viewing. It would be nice if there was a way to clear the set URL and return to the home page to view stats? I used the Stats button at the top right of the site when I was on a page, a page I didn't care about but just wanted to go into Stats to view.
Went ahead and got this done for next version. The URI filtering of chart data is presented using XenForo's filter system, rather than a form row. This allow you to remove the filter with a click. See how the URI-specific option can be removed with the X here:

1655062094669.webp
 
When I goto link my account I get this error message:

Code:
Oops! We ran into some problems.
Something went wrong. Please try again or contact the administrator.
 
What URL are you at when you see that error? Is it a XenForo error, a Google error, or?

If it's a Google error, the only thing I can think of is if your Google Account isn't already setup for Google Analytics (can't grant access to something you don't have). If it's a XenForo error, what does the error log say?
 
I have a google analytics account. I upgraded it to GA4. This is the url that it sends me to with the opps we ran into an issue: admin.php?options/google-analytics-oauth&code=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx I would like to just manually enter my measurement id but it won't allow this. Any help would be much appreciated.

Thanks,
Itworx4me
 
Top Bottom