Reputation: 410
I have a problem that i have never seen before. I have some event tracking and also the normal pageview tracking. And on some pages i get this error message when i do a record with tag assistance: "This page took a long time to send a pageview hit to Google Analytics. Users could be clicking away from your site before it records a pageview"
And it sometimes it takes around 8s before it sends the pageview. I have added the ga code in the head section before any other script is loaded. I have tried to turn of the async loading of the ga code. But nothing helps. I still get the same error message.
This is the ga code that i'm using to send the pageview.
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=0;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-my-tracking-code', 'auto');
ga('send', 'pageview')
Så does anyone have any clue what to do about this? I contacted google analytics support, but they have no training in the developer section about this so the any thing they said was that i needed to try to optimize my page. But i think if i don't have async on then the page should not load before the pageview is sent.
Upvotes: 0
Views: 703
Reputation: 30461
This probably just means that your page is slow in general. It's probably not an issue you need to worry about. If your page loads super quickly and then the pageview is sent much later, then you should try to figure out what's going on.
Upvotes: 0