[DigitalPoint] Better Google Analytics

[DigitalPoint] Better Google Analytics 1.0.7.2

No permission to download

Mr. Jinx

Well-known member
I currently have the same 500 error and as you say must be something on Google's end.

The only problem with this is that it prevents the complete ACP dashboard from loading.
Other sections in ACP are working.
 

digitalpoint

Well-known member
I checked a couple of my sites, and I did see something similar on one of them on August 19, but nothing before or after. My guess is that Google is (or was) having an issue with a particular data center today. Google doesn't have just a single web server (or data center). If issues come up with a data center, they typically route requests away from that data center within 5 minutes. They use a 5 minute TTL on their DNS records (which means clients need to relook up IP addresses for their properties every 5 minutes exactly for the purpose of them being able to quickly route people elsewhere when needed).

Ultimately it's an error from Google's web server/data center though, and I suspect they have already fixed/routed traffic away from whatever the issue was. I haven't seen it on my end, but again... Google has a whole lot of data centers, so my guess is that they had an issue with one and hopefully they have already routed traffic away from that data center.

Edit: I spoke too soon, I just saw it on one of my sites too.
 

digitalpoint

Well-known member
Looks like others have reported it to Google already (I'm sure they probably already knew on their end as well). It's already been assigned to someone at Google, so I assume they are sorting it out. It would be a pretty big thing basically affecting everyone using Google Analytics.


It doesn't seem like it's every time, I've been able to reload and then it works, then reload again and it's broken again. So definitely some issues on Google's side with their API.
 

digitalpoint

Well-known member
Ya, I'm tossing around the idea of making a setting and let people suppress (or not) the error. Personally, I would want to know when Google servers are failing, but I suppose others might not care.
 

ENF

Well-known member
Can't seem to trace this error down, but appears to be related to this addon:

Code:
ErrorException: Google Analytics Measurement protocol debug: { "validationMessages": [ ] } src/XF/Error.php:77
Generated by: user Sep 4, 2022 at 9:05 PM
Stack trace
#0 src/XF.php(219): XF\Error->logError('Google Analytic...', false)
#1 src/addons/DigitalPoint/Analytics/GoogleApi/Measurement.php(25): XF::logError('Google Analytic...')
#2 src/addons/DigitalPoint/Analytics/Repository/Measurement.php(11): DigitalPoint\Analytics\GoogleApi\Measurement->__destruct()
#3 src/addons/DigitalPoint/Analytics/XF/Mail/Mailer.php(110): DigitalPoint\Analytics\Repository\Measurement->collect('f2cafb22-e772-4...', Array, '53665')
#4 src/XF/Mail/Mail.php(458): DigitalPoint\Analytics\XF\Mail\Mailer->send(Object(Swift_Message), NULL, NULL, true)
#5 src/XF/Service/User/EmailChange.php(192): XF\Mail\Mail->send()
#6 src/XF/Service/User/EmailChange.php(157): XF\Service\User\EmailChange->sendEmailChangedNotice()
#7 src/XF/Service/User/EmailChange.php(95): XF\Service\User\EmailChange->onEmailChange()
#8 src/XF/Pub/Controller/Account.php(267): XF\Service\User\EmailChange->save()
#9 src/XF/Mvc/FormAction.php(189): XF\Pub\Controller\Account->XF\Pub\Controller\{closure}(Object(XF\Mvc\FormAction))
#10 src/XF/Pub/Controller/Account.php(217): XF\Mvc\FormAction->run()
#11 src/XF/Mvc/Dispatcher.php(352): XF\Pub\Controller\Account->actionEmail(Object(XF\Mvc\ParameterBag))
#12 src/XF/Mvc/Dispatcher.php(259): XF\Mvc\Dispatcher->dispatchClass('XF:Account', 'Email', Object(XF\Mvc\RouteMatch), Object(SV\BookmarkEssentials\XF\Pub\Controller\Account), NULL)
#13 src/XF/Mvc/Dispatcher.php(115): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(SV\BookmarkEssentials\XF\Pub\Controller\Account), NULL)
#14 src/XF/Mvc/Dispatcher.php(57): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#15 src/XF/App.php(2353): XF\Mvc\Dispatcher->run()
#16 src/XF.php(524): XF\App->run()
#17 index.php(20): XF::runApp('XF\\Pub\\App')
#18 {main}
Request state
array(4) {
  ["url"] => string(14) "/account/email"
  ["referrer"] => string(36) "https://somerandomdomain.com/account/"
  ["_GET"] => array(1) {
    ["/account/email"] => string(0) ""
  }
  ["_POST"] => array(6) {
    ["_xfToken"] => string(8) "********"
    ["email"] => string(24) "somebodiesemailjustadummy@spamc.xyz"
    ["password"] => string(8) "********"
    ["_xfRequestUri"] => string(9) "/account/"
    ["_xfWithData"] => string(1) "1"
    ["_xfResponseType"] => string(4) "json"
  }
}

Different source, same error.

Code:
ErrorException: Google Analytics Measurement protocol debug: { "validationMessages": [ ] } src/XF/Error.php:77
Generated by: Unknown account Sep 4, 2022 at 5:56 PM
Stack trace
#0 src/XF.php(219): XF\Error->logError('Google Analytic...', false)
#1 src/addons/DigitalPoint/Analytics/GoogleApi/Measurement.php(25): XF::logError('Google Analytic...')
#2 src/addons/DigitalPoint/Analytics/Repository/Measurement.php(11): DigitalPoint\Analytics\GoogleApi\Measurement->__destruct()
#3 src/addons/DigitalPoint/Analytics/XF/Mail/Mailer.php(110): DigitalPoint\Analytics\Repository\Measurement->collect('1d280966-7044-4...', Array, '42544')
#4 src/XF/Mail/Queue.php(148): DigitalPoint\Analytics\XF\Mail\Mailer->send(Object(Swift_Message), NULL, Array)
#5 src/XF/Job/MailQueue.php(12): XF\Mail\Queue->run(8)
#6 src/XF/Job/Manager.php(260): XF\Job\MailQueue->run(8)
#7 src/XF/Job/Manager.php(202): XF\Job\Manager->runJobInternal(Array, 8)
#8 src/XF/Job/Manager.php(86): XF\Job\Manager->runJobEntry(Array, 8)
#9 job.php(43): XF\Job\Manager->runQueue(false, 8)
#10 {main}
Request state
array(4) {
  ["url"] => string(8) "/job.php"
  ["referrer"] => string(70) "https://somerandomdomain.com/conversations/someconversation.546231/page-2"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}

XF 2.2.10 PL1 / PHP 8.0.23 / NGINX
 

digitalpoint

Well-known member
Turn off the debug option at the bottom of the Analytics options.

Both of those “errors” say it’s a debug message. I should probably make that more clear on the option. 😀
 

ENF

Well-known member
Turn off the debug option at the bottom of the Analytics options.

Both of those “errors” say it’s a debug message. I should probably make that more clear on the option. 😀
You know, as usual, I realized that after I posted my message above. :ROFLMAO: Dually noted. Thanks.
 

digitalpoint

Well-known member
I've also changed the explanation for that option to specifically say that, so it will be in the next version in case others run into it.

It's now this:
Enables debugging so you can see events come across DebugView in Google Analytics. Additionally, this adds a debugging entry to your server error log when the Measurement Protocol is used for server-side events (for example emails being sent/viewed).
 
  • Like
Reactions: ENF

djbaxter

in memoriam 1947-2022
@digitalpoint

I have this installed on two forums. The first shows icons at the top left of the header:

better-analytics-icons.png

The second shows no icons there and I can't see where to click to display the data:

better-analytics-no-icons.png

Both are using the same PixelExit style.

Both are enabled via Google.

Both have been upgraded to version 1.06. I THINK when I first installed this both of these forums were displaying the icons.

Without the icons, I can't find a link anywhere to display the stats.

What am I missing here? A permissions setting?A style setting?
 

digitalpoint

Well-known member
I suspect it might be an issue with the style (probably not coincidental that you are using a custom style). But here's a few things you can check...
  • For the button to show in the staff bar, the admin user needs the admin permission View statistics (or they need to be a super administrator).
  • Make sure the template modification for PAGE_CONTAINER: Adds analytics button to staffBar is enabled and that the numbers to the right of it show 1 / 0 / 0 (under Admin -> Appearance -> Template modifications).
If the template modification is enabled, but the numbers are different, it's most likely an issue with the PAGE_CONTAINER template in that custom style.

Also, the button in the staff bar is for analytics for the specific page you are looking at, but you can get to the overall stats under Admin -> Logs -> Analytics
 

djbaxter

in memoriam 1947-2022
Thank you.

Following up on your points, I found a few errors in PAGE_CONTAINER caused by 2 or 3 addons I wasn't even using. Uninstalled those and now your addon is working fine and displaying the icons as it should.

So not a problem with your addon at all. Just needed to get rid of some older non-essential addons I had installed in the past.
 

digitalpoint

Well-known member

K a M a L

Well-known member
When emailing users in plain text, tracking pixel is still injected if email tracking is enabled resulting in blank looking emails
1664992826774.png
 

digitalpoint

Well-known member
When emailing users in plain text, tracking pixel is still injected if email tracking is enabled resulting in blank looking emails
View attachment 274433
A temporary workaround would be to not use plain-text email (even if it's only plain-text).

If you go into the DigitalPoint\Analytics\XF\Mail\Mailer.php file and change this:
PHP:
if (!empty(\XF::options()->baEvents['email']))
...to this:
PHP:
if (!empty(\XF::options()->baEvents['email']) && !empty($return['html']))

It should sort it out (it simply won't try to track if it's not HTML, since it can't).
 

willl

Active member
Asking this on behalf of a customer :) When attempting to select the GA4 property after connecting the GA account, this error pops up.

InvalidArgumentException: The caller does not have permission in src/addons/DigitalPoint/Analytics/GoogleApi/AbstractApi.php at line 31 [LIST=1] [*]DigitalPoint\Analytics\GoogleApi\AbstractApi->makeApiCall() in src/addons/DigitalPoint/Analytics/GoogleApi/Admin.php at line 74 [*]DigitalPoint\Analytics\GoogleApi\Admin->measurementProtocolSecretsList() in src/addons/DigitalPoint/Analytics/Repository/Reporting.php at line 136 [*]DigitalPoint\Analytics\Repository\Reporting->getMeasurementProtocolSecret() in src/addons/DigitalPoint/Analytics/XF/Admin/Controller/Option.php at line 80 [*]DigitalPoint\Analytics\XF\Admin\Controller\Option->actionGoogleAnalyticsSelect() in src/XF/Mvc/Dispatcher.php at line 352 [*]XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 259 [*]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 2353 [*]XF\App->run() in src/XF.php at line 524 [*]XF::runApp() in admin.php at line 13 [/LIST]
 
Top