Category Archives: Analytics

Site Speed Reporting in Analytics

My company has recently embarked on a quest to figure out what CDN will perform the best for our website. I did the normal speed tests from google and WebPageTest as well as looking over data from the network element loading timeline from the chrome developer tools window (or the ‘Net’ tab in firebug). I did however, want to track the averages of my page speed stats over time, which is why I turned to the Google Analytics Site Speed Report, and got this:
If you wanted to know, that spike to the right was 77 seconds. Cool.
This isn’t our primary website, but comparing the line graphs yields fairly similar results. You’ll notice that in the past 5 months, only 14 visitors had their site speed data recorded, which is not as useful for me as it could have been.

Kinda Stingy, eh Google?

Google Analytics out of the box only reports 1% of users’ site speed data, meaning that if you don’t have thousands of people coming to your website every day, you’re not going to get accurate insights from this report unless you change the way that GA reports the data. Fortunately, fixing this is a piece of cake.

If you’re using universal analytics, you’ll have a line in your tracking code that reads:

ga('create', 'UA-XXXX-Y', 'auto');

Just change this to

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

(Note: This will sample 100% of up to 10,000 daily visitors in your report. If you want to sample a lower percentage, just change the ‘100’ to a lower number.)

Now in the past 5 days, compared to the past 5 months, we have 25 pageviews with sampled data.
If anyone wanted to know what browser was the slowest, it was the Android Browser, followed by our trusty friend, IE10. Tsk Tsk Tsk.
Oooh. We should clean up this website load time. Too bad I don’t actually care about this one.

The reference page for Universal Analytics can be found here, and the reference for Classic Analytics can be found here.

Happy Sampling!