Google released the new Analytics.js
(https://developers.google.com/analytics/devguides/collection/analyticsjs/). I would like to use it, and I already have everyting set up just fine, apart from site speed.
In the "old" ga.js
you could do this with
_gaq.push(['_setSiteSpeedSampleRate', 50]);
This would set it so 50% of the visitors would report sitespeed to analytics.
However, for the new analytics.js
I cannot get it to work. I tried the following 2:
ga('send','setSiteSpeedSampleRate',50);
ga('setSiteSpeedSampleRate',50);
But no results. Any ideas?
The Speed Suggestions report lets you see the speed of your website across metrics like Avg. Page Download Time (sec) and Avg. Server Response Time (sec). The report enables you to identify areas for improvement across your site and on specific pages so you can make your pages load faster.
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.
A pageview is simply each time the ga('send', 'pageview'); javascript is evoked. It usually happens just once per pageload, within the main Google Analytics code. However, if you place this line 10 times on the same page it will register 10 pageviews, when the user has only loaded one page.
Ah, I found my answer. It now has to be set in the create method like this:
ga('create', 'UA-39262824-7', {'siteSpeedSampleRate': 100});
There are more fields that can be used there, found it here: Google Analytics Site Speed Sample Rate
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