How to increase Site Speed Sampling Rate in Google Analytics ?

How to increase Site Speed Sampling Rate in Google Analytics ?

What is Site Speed in Google Analytics?

Site Speed reports show how fast a visitor can access your web pages and interact with your content.

Why Site Speed Data is Important?

As we know, when a web page loads, a lot of data gets transmitted between a visitors laptop and the server, where the website is hosted. But all these things happen in the back end, which visitor do not give much importance to. You visitor only sees how fast he can access your page. If it takes longer, consider that you have lost your future customer.

So it is very important for you if you are the website owner or business owner to understand the back end process. So that your can fix it and provide a better user experience to your web page visitors. Who would become your customer later.

Few of the important metrics involved in the process is explained below.

  • Page Load Time – Time takes to show all the content of a page since it’s initiation.
  • Domain Lookup Time – Time taken for DNS lookup.
  • Server Connection Time – Time taken for the user’s request to reach website hosting server.
  • Server Response Time – Time taken by the website hosting server to respond to user’s request.
  • Page Download Time – Time required to download the page.

We can find these details from a report in Google Analytics. And it can be accessed at Behavior > Site Speed > Page Timings 

According to some research Ideal Website Load Time is 3 secs

Since these metrics can give you insight of your website behavior, it needs continues monitoring and hence improvement.

What is the issue with Google Analytics default data accumulation process?

Google does not consider all your of your web page visitor’s data to give you the reports and show infographics. It takes only a few random samples.

Yes, you heard it right!

By default, this Sampling Rate is set to 1%.

Sampling considerations according to Google is as below.

Total pageview count (previous day)Maximum number of timing events that will be processed
0 – 1,000100
1,000 – 100,00010% of total pageview count
100,000 – 1,000,00010000
1,000,000+1% of total pageview count

By default, this Sampling Rate is set to 1%. The issue arises when Google Analytics considers these sampled data for average calculations.

Consider the below example.

You have 400 visits and Sampling Rate has been set to 1% which is only 4 visits out of 400.

Imagine, what if those 4 visits(samples) have below mentioned load time ?

 Page Load Sample # Load Time in Seconds

That looks pretty bad! Huh!

Just because, one of the page load sample time is too high, the average value shown looks higher than the actual site average value. Which is a wrong insight about the website performance.

How do I get my data right ?

The simplest solution is to, increase the Sampling Rate. Which could give us a better insight of the performance metrics.

All you need to do is, Add the below code snippet to Universal Analytics Code. Which might reside in the header file if the website if you have directly linked Google Analytics with your website. Or in the Page Load GTM Tag, if you are using Google Tag Manager.

ga(‘create’, ‘UA-XXXX- Y’, {‘siteSpeedSampleRate’: 100});

‘UA-XXXX- Y’ – Replace this with your Google Analytics Tracking ID

The above code gives you 100% Site Speed Sampling Rate.

You can use any value from 1 to 100 depending on your requirement. 

Isn’t that great? One small tweak and you are good to go?

Please refer to Google, for more info :

How do I confirm if I have set the tweak right ?

The above code gives you 100% Site Speed Sampling Rate.

Once you add the code, wait for a day or two for it to process and collect data.

Access the same report at Behavior > Site Speed > Page Timings

Go to the ‘ Distribution ‘ Tab. And you should see your data.

In the above example, though we had set Sampling Rate as 100%, some limitations set by Google gave us reports at 88.5% Sample Rate, which is still way better than default 1% Sample Rate.


Still got questions? Shoot it in the comment section below!

This Post Has 6 Comments

  1. Nice One

    1. Thank you Varun!

    1. Thank you Surej!

  2. Very informative! Thank you for sharing it ☺.

    1. Thank you Kavya! 🙂

Leave a Reply