user23048345
user23048345

Reputation: 3173

Recording request page time with google analytics

It's easy enough to record how long a page takes to load using Events with Google Analytics and I can find plenty of examples of how to do that by searching. The problem is most of these methods record the start time as being the moment the page starts to load so in effect all it tells you is how long the page took to render in a browser. I want to time the full page lifecycle, ie from when the request begins until the browser has completely rendered the page to the user.

Anyone know how to do that with GA?

Is there any way to get from the browser when the request started, rather than having to record a timestamp in javascript?

Upvotes: 1

Views: 416

Answers (1)

Yahel
Yahel

Reputation: 37305

EDIT: The prior answer was from before Google Analytics released its Site Speed feature; it's far preferable to use the built-in feature, which uses the HTML5 Navigation Timing API.

By default, the Site Speed feature is enabled and samples 1% of traffic.

To increase the sample rate, just add this line before your _trackPageview call, setting the second argument to what percent of your traffic you'd like to track (though Google will only record up to 10,000 visits):

_gaq.push(['_setSiteSpeedSampleRate', 50]); //50%

Upvotes: 3

Related Questions