[DigitalPoint] Better Google Analytics

[DigitalPoint] Better Google Analytics 1.0.10

No permission to download
I think you've got a typo in the helper_js_analytics template.

It's defining an ads_impression event instead of ad_impression
 
I've got this going on a few sites, but on a few sites it would fail. I think it's having an issue with the oAuth process. It doesn't give me much of an error except the built in Xenforo error.

Code:
[HEADING=2]Oops! We ran into some problems.[/HEADING]
Something went wrong. Please try again or contact the administrator.

It happens right after I link the google account and click "allow".

I've installed it on 5 sites without issue, and an additional 3 had the issue. Trying it multiple times gives the same error.
 
Anything in your XenForo error log?
No, but I figured out the issue.

If I use the domain.com to log into the Admin control panel it won't work. We do have Xenforo set up to use Canonical links. If I specify www.domain.com to go into the admin control panel it works.

The webservers allow both domains and we just use Enable board URL canonicalization setting.
 
randomizing the gtm.js filename per install might help prevent adblock from blocking it
Maybe... but probably not. If an adblocker is blocking any HTTP request that contains "gtm.js", they most definitely are blocking all requests going to www.google-analytics.com, which is where the browser is sending the actual analytics data. So it really wouldn't serve much purpose in the end.
 
Requests:

1) Be able to plot multiple dimensions on the same chart.
2) Be able to save multiple dimension plots as a new dimension option.
3) Be able to display any chart in a bar graph view.
4) Be able to link to any dimension plots directly through a unique url. (e.g. admin.php?analytics/charts/bar-graph/90-day-pageviews-sessions-new-users/)
 
Isn't that all stuff (plus a lot more) you can already do in the normal Google Analytics interface? Not sure I really want to go down the road of completely replacing their entire UI...
 
Isn't that all stuff (plus a lot more) you can already do in the normal Google Analytics interface? Not sure I really want to go down the road of completely replacing their entire UI...
That may be, I stopped using GA directly once I installed your add-on. It gives me what I need and saves me a little time.
 
@digitalpoint
I suddenly have a lot of various server errors related to your addon
Code:
[LIST]
[*]GuzzleHttp\Exception\RequestException: Failed to refresh OAuth access token for baAnalyticsCredentials: cURL error 77: (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)
[*]src/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:201
[/LIST]
#0 src/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(155): GuzzleHttp\Handler\CurlFactory::createRejection(Object(GuzzleHttp\Handler\EasyHandle), Array)
#1 src/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(105): GuzzleHttp\Handler\CurlFactory::finishError(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory))
#2 src/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php(43): GuzzleHttp\Handler\CurlFactory::finish(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory))
#3 src/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php(28): GuzzleHttp\Handler\CurlHandler->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
#4 src/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php(51): GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler\{closure}(Object(GuzzleHttp\Psr7\Request), Array)
#5 src/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php(66): GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler\{closure}(Object(GuzzleHttp\Psr7\Request), Array)
#6 src/vendor/guzzlehttp/guzzle/src/Middleware.php(29): GuzzleHttp\PrepareBodyMiddleware->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
#7 src/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php(70): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Request), Array)
#8 src/vendor/guzzlehttp/guzzle/src/Middleware.php(57): GuzzleHttp\RedirectMiddleware->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
#9 src/vendor/guzzlehttp/guzzle/src/HandlerStack.php(71): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Request), Array)
#10 src/vendor/guzzlehttp/guzzle/src/Client.php(351): GuzzleHttp\HandlerStack->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
#11 src/vendor/guzzlehttp/guzzle/src/Client.php(162): GuzzleHttp\Client->transfer(Object(GuzzleHttp\Psr7\Request), Array)
#12 src/vendor/guzzlehttp/guzzle/src/Client.php(182): GuzzleHttp\Client->requestAsync('POST', Object(GuzzleHttp\Psr7\Uri), Array)
#13 src/XF/ConnectedAccount/Http/Client.php(51): GuzzleHttp\Client->request('POST', 'https://account...', Array)
#14 src/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/AbstractService.php(221): XF\ConnectedAccount\Http\Client->retrieveResponse(Object(OAuth\Common\Http\Uri\Uri), Array, Array)
#15 src/addons/DigitalPoint/Analytics/Repository/Analytics.php(50): OAuth\OAuth2\Service\AbstractService->refreshAccessToken(Object(OAuth\OAuth2\Token\StdOAuth2Token))
#16 src/addons/DigitalPoint/Analytics/GoogleApi/AbstractApi.php(39): DigitalPoint\Analytics\Repository\Analytics->refreshAnalyticsTokenIfNeeded()
#17 src/addons/DigitalPoint/Analytics/GoogleApi/AbstractApi.php(11): DigitalPoint\Analytics\GoogleApi\AbstractApi->getToken()
#18 src/addons/DigitalPoint/Analytics/GoogleApi/Data.php(26): DigitalPoint\Analytics\GoogleApi\AbstractApi->makeApiCall('properties/3593...', Array)
#19 src/addons/DigitalPoint/Analytics/Repository/Reporting.php(164): DigitalPoint\Analytics\GoogleApi\Data->runRealtimeReport('properties/3593...', Array)
#20 src/addons/DigitalPoint/Analytics/Repository/Reporting.php(561): DigitalPoint\Analytics\Repository\Reporting->runRealtimeReport(Array)
#21 src/addons/DigitalPoint/Analytics/Template/Callback/Analytics.php(167): DigitalPoint\Analytics\Repository\Reporting->getRealtime()
#22 src/XF/Template/Templater.php(1698): DigitalPoint\Analytics\Template\Callback\Analytics::getRealtime('', Array, Object(XF\Template\Templater))
#23 internal_data/code_cache/templates/l1/s0/admin/index.php(206): XF\Template\Templater->callback('DigitalPoint\\An...', 'getRealtime', '', Array)
#24 src/XF/Template/Templater.php(1654): XF\Template\Templater->{closure}(Object(XF\Template\Templater), Array, NULL)
#25 src/XF/Template/Template.php(24): XF\Template\Templater->renderTemplate('index', Array)
#26 src/XF/Mvc/Renderer/Html.php(50): XF\Template\Template->render()
#27 src/XF/Mvc/Dispatcher.php(460): XF\Mvc\Renderer\Html->renderView('XF:Index', 'admin:index', Array)
#28 src/XF/Mvc/Dispatcher.php(442): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#29 src/XF/Mvc/Dispatcher.php(402): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#30 src/XF/Mvc/Dispatcher.php(60): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#31 src/XF/App.php(2487): XF\Mvc\Dispatcher->run()
#32 src/XF.php(524): XF\App->run()
#33 admin.php(13): XF::runApp('XF\\Admin\\App')
#34 {main}

Code:
[LIST]
[*]GuzzleHttp\Exception\RequestException: cURL error 77: (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)
[*]src/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:201
[/LIST]
#0 src/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(155): GuzzleHttp\Handler\CurlFactory::createRejection(Object(GuzzleHttp\Handler\EasyHandle), Array)
#1 src/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(105): GuzzleHttp\Handler\CurlFactory::finishError(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory))
#2 src/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php(43): GuzzleHttp\Handler\CurlFactory::finish(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory))
#3 src/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php(28): GuzzleHttp\Handler\CurlHandler->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
#4 src/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php(51): GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler\{closure}(Object(GuzzleHttp\Psr7\Request), Array)
#5 src/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php(66): GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler\{closure}(Object(GuzzleHttp\Psr7\Request), Array)
#6 src/vendor/guzzlehttp/guzzle/src/Middleware.php(29): GuzzleHttp\PrepareBodyMiddleware->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
#7 src/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php(70): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Request), Array)
#8 src/vendor/guzzlehttp/guzzle/src/Middleware.php(57): GuzzleHttp\RedirectMiddleware->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
#9 src/vendor/guzzlehttp/guzzle/src/HandlerStack.php(71): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Request), Array)
#10 src/vendor/guzzlehttp/guzzle/src/Client.php(351): GuzzleHttp\HandlerStack->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
#11 src/vendor/guzzlehttp/guzzle/src/Client.php(162): GuzzleHttp\Client->transfer(Object(GuzzleHttp\Psr7\Request), Array)
#12 src/vendor/guzzlehttp/guzzle/src/Client.php(182): GuzzleHttp\Client->requestAsync('POST', Object(GuzzleHttp\Psr7\Uri), Array)
#13 src/XF/ConnectedAccount/Http/Client.php(51): GuzzleHttp\Client->request('POST', 'https://account...', Array)
#14 src/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/AbstractService.php(121): XF\ConnectedAccount\Http\Client->retrieveResponse(Object(OAuth\Common\Http\Uri\Uri), Array, Array)
#15 src/addons/DigitalPoint/Analytics/XF/Admin/Controller/Option.php(27): OAuth\OAuth2\Service\AbstractService->requestAccessToken('4/0AfJohXm2flyC...')
#16 src/XF/Mvc/Dispatcher.php(352): DigitalPoint\Analytics\XF\Admin\Controller\Option->actionGoogleAnalyticsOAuth(Object(XF\Mvc\ParameterBag))
#17 src/XF/Mvc/Dispatcher.php(258): XF\Mvc\Dispatcher->dispatchClass('XF:Option', 'GoogleAnalytics...', Object(XF\Mvc\RouteMatch), Object(DigitalPoint\Analytics\XF\Admin\Controller\Option), NULL)
#18 src/XF/Mvc/Dispatcher.php(115): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(DigitalPoint\Analytics\XF\Admin\Controller\Option), NULL)
#19 src/XF/Mvc/Dispatcher.php(57): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#20 src/XF/App.php(2487): XF\Mvc\Dispatcher->run()
#21 src/XF.php(524): XF\App->run()
#22 admin.php(13): XF::runApp('XF\\Admin\\App')
#23 {main}
 
That's an SSL certificate issue with your server. Make sure curl is up to date on your server and/or make sure your SSL certificates are up to date (won't be specific to the addon beyond the fact that it needs to be able to communicate over HTTPS). Most likely will affect other things using HTTPS like image proxies, PayPal IPN verifications, etc.

CURLE_SSL_CACERT_BADFILE (77)
Problem with reading the SSL CA cert (path? access rights?)

Curl error 77 error is a server-side error. This error indicated that the chain certificate files are missing or “broken”. Usually, this error happens simply by outdated SSL certificate(s) for cURL installed on the server.
 
Thank you.
I haven't done anything on the server to cause those errors.
ssl certificate is valid I believe

# curl -V
curl 7.29.0 (x86_64-redhat-linux-gnu) libcurl/7.29.0 NSS/3.53.1 zlib/1.2.7 libidn/1.28 libssh2/1.8.0
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smtp smtps telnet tftp
Features: AsynchDNS GSS-Negotiate IDN IPv6 Largefile NTLM NTLM_WB SSL libz unix-sockets
 
It's not the SSL certificate for your domain, it's the certificates that tell your server which SSL authorities to trust and how long to trust them (they need to be updated every once in awhile because the time to trust doesn't last forever). For example in my servers, they are in the /etc/ssl/certs folder. They might be somewhere else in your server. The certificates usually last a good amount of time so it could also be a permission issue (if PHP/curl can't read the certificates, it would be the same as them not existing).

Probably something to just ask your server admin about.
 
I'll check with @eva2000 to see if any of the recent update on his centminmod is related to this.
In the meantime, I see multiple instances of this error as well. I wonder if it's a related or different issue

Server error log
  • Error: Call to a member function getBody() on null
  • src/addons/DigitalPoint/Analytics/Repository/JavaScript.php:53
  • Generated by: Unknown account
  • 11/13/23 at 12:56 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(8)
#3 src/XF/Job/Manager.php(202): XF\Job\Manager->runJobInternal(Array, 8)
#4 src/XF/Job/Manager.php(86): XF\Job\Manager->runJobEntry(Array, 8)
#5 job.php(43): XF\Job\Manager->runQueue(false, 8)
#6 {main}
 
If they started around the same time, I'd say they are probably related to the underlying issue that your server can't communicate over TLS/HTTPS. The curl error you got in the other message is the one you get when curl can't read the necessary SSL certs on the server. So in all likelihood they are either missing, the "user" that is reading them at the operating system level doesn't have read permissions or it could simply be looking in the wrong place. But fundamentally it's about the SSL certificates on the server and them not being able to be read.
 
Top Bottom