When I look at Behavior | Site Speed |Overview in GA I get the message:
"0 of pageviews sent page load sample"
How are these enabled? Or is this a ga() call you have to make from DOM Ready?
Thanks
If you want a quick answer, the Google recommended page load time is under two seconds: “Two seconds is the threshold for ecommerce website acceptability. At Google, we aim for under a half-second.”
TLDR Answer: Serve your customers with the page load time they need, a good goal being 1-2 seconds.
You can speed up sites using Google Analytics with two simple changes. Move your analytics code to the bottom, and localize the JavaScript file. This article showed the effect of these changes on a real-world example with waterfall graphs.
Page Timings & User Timings reports > Distribution tab To get the speed detail for a specific page or resource, you can drill down into the item in the Explorer tab, and then click the Distribution tab to see the distribution of load/execution times.
You need to set your sample set higher. I believe the default is only 10%. I'll paste code below once I get it from my BitBucket repo.
Notice the "siteSpeedSsampleRate" property. I set mine to 100% because I'm greedy and want to know about ALL page views. Helps when I don't have more than 100k page views per month...
(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 = 1;
a.src = g;
m.parentNode.insertBefore(a, m);
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
ga('create', 'UA-xxxxxxxxx-x', {'siteSpeedSampleRate': 100});
ga('require', 'linkid', 'linkid.js');
ga('send', 'pageview');
FYI - this is the part that is needed:
{'siteSpeedSampleRate': 100}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With