Better Analytics

Better Analytics 3.1.1

No permission to download
Do you have multiple properties within your Google Analytics account? I wonder if there is some issue with it checking the right one.
Just to confirm removing the multiple properties in my analytics account and creating new one's has fixed my issue - now seeing a lot more green :D

Everything that I was adding in came under a different UA number originally.

Problem solved, Cheers!
 
Added Google Analytics event trigger 15 seconds after page loads to give a more accurate bounce rate.
@digitalpoint Shawn, we think that this trigger is happening before the page has loaded for Google Analytics leading to GA assigning the event to an unknown page. This leads to an entry of 'other' in the pages list where the number of page views and unique page views are the same.
1.webp
plus we're getting strange self-referral errors
2.webp
Can we extend this 15 seconds to, say, 60? How would we change it?
 
That has to do with how Google Analytics handles high-cardinality values (for example page URLs on a large site). Pages displayed as "(other)" is because Google Analytics puts all pages not in your top 50,000 for the day into that one lumped "other".

See this article for more info: https://support.google.com/analytics/answer/1009671?hl=en
No Shawn, I understand what you're saying, but there is more to it than that.
The number of page views being *exactly* the same as the number of unique page views points to these 'pages' being generated because a trigger event has been detected before GA has identified the page and to compensate, it generates phantom page views to associate the event with.
Also the self-referrals error points to the same issue.
We want to change the 15 seconds to 60 to see what happens. How do we do that, please?
 
Honestly, I doubt that's going to be the case unless you have something really funky going on with your site somehow (as in some really strange way that he DOM loads for your pages). Specifically, Better Analytics doesn't fire *any* JS code until after the page as finished loading. All JS is wrapped inside a jQuery $(document).ready() method (info on that here: https://learn.jquery.com/using-jquery-core/document-ready/ ).

That means it doesn't load the Google Analytics JS until the page is FINISHED loading. It also doesn't even start the 15 second timer for secondary events until AFTER the page view is logged.

If you look at the better_analytics_javascript template, you can see the JS code being used. The entire thing is wrapped in the .ready() method, the ga("send", "pageview"); happens before the setTimeout() function is called on the next line which will fire the event 15 seconds later. If you want to alter the timing of it, you can change it from 15000 ms to whatever you want. But I'm pretty sure that whatever is going on with your site isn't related to that. Like I said, firing the event 15 seconds after the page view is logged, immediately after the page view is logged or 60 minutes after the page view is logged isn't going to somehow make the event fire before the pageview is logged. Again, the timer doesn't START until after the page view is logged.

If you have something weird going on with Google Analytics, you probably are going to need to duplicate it happening and see whatever it is happening in something like Chrome's network inspector/developer tools. If you are running any third party JavaScript (which could be things like advertising, any iframes, social buttons, etc.) on your site, they might have their own Google Analytics code that is interfering with yours. And the first step in finding what the source might be would be to visually see it happening in the underlying network traffic. Then you can see what JS code triggered whatever it is that is out of place.
 
Honestly, I doubt that's going to be the case unless you have something really funky going on with your site somehow (as in some really strange way that he DOM loads for your pages). Specifically, Better Analytics doesn't fire *any* JS code until after the page as finished loading. All JS is wrapped inside a jQuery $(document).ready() method (info on that here: https://learn.jquery.com/using-jquery-core/document-ready/ ).

That means it doesn't load the Google Analytics JS until the page is FINISHED loading. It also doesn't even start the 15 second timer for secondary events until AFTER the page view is logged.

If you look at the better_analytics_javascript template, you can see the JS code being used. The entire thing is wrapped in the .ready() method, the ga("send", "pageview"); happens before the setTimeout() function is called on the next line which will fire the event 15 seconds later. If you want to alter the timing of it, you can change it from 15000 ms to whatever you want. But I'm pretty sure that whatever is going on with your site isn't related to that. Like I said, firing the event 15 seconds after the page view is logged, immediately after the page view is logged or 60 minutes after the page view is logged isn't going to somehow make the event fire before the pageview is logged. Again, the timer doesn't START until after the page view is logged.

If you have something weird going on with Google Analytics, you probably are going to need to duplicate it happening and see whatever it is happening in something like Chrome's network inspector/developer tools. If you are running any third party JavaScript (which could be things like advertising, any iframes, social buttons, etc.) on your site, they might have their own Google Analytics code that is interfering with yours. And the first step in finding what the source might be would be to visually see it happening in the underlying network traffic. Then you can see what JS code triggered whatever it is that is out of place.
Many thanks for the useful reply, Shawn. We are working with a team of analytics experts and I'll ask them to take a look at your reply to help further identify what's happening.
 
@digitalpoint

I have the premium version of the add-on and over the past month or so I've noticed the heatmaps have stopped working. It displays blue without any noticeable data.

Things I have tried:

  • Confirming Google API Credentials
  • I checked my API quotas, they are very small (only a few queries) nowhere near the quota
  • Checking my property ID and ensuring the correct view is selected
  • Adjusted the heatmap date range to large and small samples
  • Adjusted the heatmap metrics and segments to the broadest categories
All other functioning seems to work fine. In Test Analytics Setup everything is green except catch.

I am unable to generate errors I can tie directly to Better Analytics. However, I have gotten a few scattered mailing errors. Previous ones have no reference to this add-on, except the error below:

Code:
Zend_Mail_Protocol_Exception: cannot connect to host; error = php_network_getaddresses: getaddrinfo failed: Name or service not known (errno = 0 ) - library/Zend/Mail/Protocol/Pop3.php:109
Generated By: Unknown Account, 6 minutes ago
Stack Trace
#0 /home/admin/public_html/library/Zend/Mail/Storage/Pop3.php(190): Zend_Mail_Protocol_Pop3->connect('server.wordoutl...', 995, 'TLS')
#1 /home/admin/public_html/library/XenForo/Model/EmailBounce.php(288): Zend_Mail_Storage_Pop3->__construct(Array)
#2 /home/admin/public_html/library/XenForo/Deferred/EmailBounce.php(19): XenForo_Model_EmailBounce->openBounceHandlerConnection()
#3 /home/admin/public_html/library/XenForo/Model/Deferred.php(295): XenForo_Deferred_EmailBounce->execute(Array, Array, 7.99999904633, '')
#4 /home/admin/public_html/library/XenForo/Model/Deferred.php(429): XenForo_Model_Deferred->runDeferred(Array, 7.99999904633, '', false)
#5 /home/admin/public_html/library/XenForo/Model/Deferred.php(374): XenForo_Model_Deferred->_runInternal(Array, NULL, '', false)
#6 /home/admin/public_html/deferred.php(23): XenForo_Model_Deferred->run(false)
#7 {main}
Request State
array(3) {
  ["url"] => string(42) "https://www.website.org/deferred.php"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(4) {
   ["_xfRequestUri"] => string(31) "/admin.php?analytics/test-setup"
   ["_xfNoRedirect"] => string(1) "1"
   ["_xfToken"] => string(8) "********"
   ["_xfResponseType"] => string(4) "json"
  }
}
 
Thanks, I opened a support ticket with my host. I'll update once I can find the solution.

Any update on incorporating split testing? I know there was some talk about it a while back.
 
Thanks, I opened a support ticket with my host. I'll update once I can find the solution.

Any update on incorporating split testing? I know there was some talk about it a while back.
At some point yeah... I've already done it with the WordPress version of Better Analytics, so the code base is largely done. Just need to find the time.
 
@digitalpoint - We noticed a problem on emails sent out from XF with the GA tag included for monitoring when an email is opened/viewed.

ga_error.webp
The underlying code looks like this: (only the GA identity is sanitized, the rest is original)

Code:
<img src="https://ci6.googleusercontent.com/proxy/OlLOEoCtTUQid4IwU_jxKuPjIhlmsm6tWrVezJpWr5uLUj6dLujKSE5qkYge2kBmULhQa8kE-1XHauzGsre3dVRmjE8geF4UPjOfH428d-SzcwBa5-olKhOFolt1hrSXv8d-IPFR7fqQ5-__E70wUDPgmvneAKhkRoG6Y2FV5vDS3wc7U1zFkgn1VS6pqhXQVMJBJYcet_XNkc44GVv-y-v7GXmrA4iIfYY49SNXyj4yE1-cxhJh7GCOyB9G7dbRMMbM5WKXz579WH5UnK9VOUXTmQwjQIGFrZLDoWP555GYyFq7_p6usvdb-tWFMrXmpsma5f0rDA=s0-d-e1-ft#https://www.google-analytics.com/collect?v=1&amp;tid=UA-XXXXXXX-1&amp;cid=1927507606.1491413369&amp;t=event&amp;ec=Email&amp;ea=Open&amp;el=Can%27t+see+the+epic+video%3A%29+-+New+reply+to+your+conversation&amp;uid=6400&amp;cd1=6400&amp;cm=email&amp;z=58f95d9037b69" class="CToWUd">

It doesn't seem to matter which ISP or location, but the resulting 404 error is the same in different locations and browsers.

Anyone else seeing this? We haven't changed anything that would impact this function....
 
Was it an old email by chance? I suspect Gmail's internal image proxy system isn't going to cache stuff forever.

That was one sample from the last 12 hours when I posted above. I'll go test this again, it's possible that we could have had some regional problems with Google connections.
 
Well 12 hours definitely shouldn't be an issue with the caching side on Googke's end. Not sure what really could be done about it though on this end. It's Gmail that's replacing the image URL, so nothing we are able to change on this end. Looks like a mucked proxy request on Google's side to be honest.
 
Well 12 hours definitely shouldn't be an issue with the caching side on Googke's end. Not sure what really could be done about it though on this end. It's Gmail that's replacing the image URL, so nothing we are able to change on this end. Looks like a mucked proxy request on Google's side to be honest.

Sorry for the late reply -- I confirmed that we're seeing this case happen on email sent in real-time. We ran a series of tests with 10 different email variations, but mainly private conversations. In each case, the image results in a 404 both in the email and when it's accessed directly by the URL. Doesn't matter which browser or ISP.

Where can we disable this function for the time being until this URL issue is resolved?

(Screenshot of generic Google 404 error page when accessed directly)

google_404.webp
 
You can disable the event for emails opened in the normal settings.
Thanks - I realized now that was a silly question to ask, I should be more careful of my morning posts. lol

I'll try to enable it again later... I'm going to have to go back through my settings in XF and GA. The Analytics test page shows no errors and other functions appear to be working fine.
 
Top Bottom