Srz
Srz

Reputation: 23

google analytics tracking code vs slow loading speed

when exactly does the GA tracking start? At page load (100%) or when the .js is loaded from section?

I have a website that has horrific loading time and additionally has 10s delay on GA tracking. Does this add-up or should I rather add the 10s with "First byte loaded" or the GA .js loaded (using webpagetest)?

I am experiencing major low bounce rate that is just way too good to be true.

Upvotes: 0

Views: 1134

Answers (2)

J Brazier
J Brazier

Reputation: 884

You're sending an event '10 seconds in', which is what's destroying your Bounce Rate. The clock will start as soon as the Analytics script is loaded, which may be well before your page is ready. Since the page hasn't loaded yet, people stick around and the event triggers - not a bounce.

To fix this, you could instead start the countdown based on the Page Load event (which is easy with Google Tag Manager).

However, I recommend you rethink your strategy. Adding an event of this nature is very damaging to the 'true' Bounce Rate, even if it's 30 or 60 seconds after the page load, and Google Analytics' careful calculated metric will be more useful to you before you break it. If you don't have another way of measuring these people's interaction with the page (such as a click event, or perhaps a scroll), then what's to say that they actually did interact with the page? They could have tabbed away, or got up to make a cup of tea.

If you are going to do this, I recommend you at least make the event a non-interaction hit, so you can still get the percentage that you want from Calculated metrics, but you won't ruin the Bounce Rate.

Upvotes: 0

Eike Pierstorff
Eike Pierstorff

Reputation: 32760

Ga may start to collecting data as soon as the ga object is created (so put the bootstrap code in the page head so as not to miss any data). However to send it the analytics.js file must be loaded. The calls are placed in the command queue

The JavaScript tracking snippet defines the initial ga() command queue function, so it can be used even before the analytics.js library is fully loaded. As soon as the analytics.js library is loaded, the items in the command queue are executed in the order they were received. Once this is done, new commands pushed onto the queue are executed immediately.

That means if the analytics.js file is never loaded (e.g. because users have aborted page load due to the long delay) the calls will not be send and you loose the data for those users. Also if you do not do any send calls before page load is aborted you won't get data, either.

(Actually you are mentioning ga.js, which indicates that you are using "classic" analytics, but that works vaguely similar by pushing commands on the _gaq array).

I am not sure how your 10 second delay on GA tracking comes to pass (does this happen by accident or is this deliberate ?) but this might explain a low bounce rate - people usually do not linger for 10 seconds before they bounce. So you should take care that the pageview call is sent as soon as possible.

Upvotes: 1

Related Questions