How to setup new Google Analytics SiteSpeed feature to measure page load time

Update: This article is now deprecated, here is the official explanation:

Previous versions of Site Speed required a tracking code change to add _trackPageLoadTime. These sites with the deprecated call will still collect speed data at the 10% sampling rate. However this call will be ignored in the future, and the sample rate will fall to the default 1%. As you maintain your site, consider updating your tracking code to use setSiteSpeedSampleRate() to set a higher sampling rate.

As you might know, the G firm evangelizes a lot about making the web faster for several years. They started several projects in order to measure your website efficiency and this is the last one. It allows to measure average load page time inside the new Google Analytics, in beta. In fact, it’s important to marketing because slow pages implies a number of emarketing side effects.

Here are the steps needed to turn it on:

1. Inside Analytics, select “New version” to open the new beta

2. By default, SiteSpeed is turned off, so you need to change your tracking code (inside your page’s code) by adding one line (as explained in GA’s help)

<script type="text/javascript">
var _gaq = _gaq || ;
_gaq.push('_setAccount', 'UA-XXXXX-X');
_gaq.push('_trackPageview');
_gaq.push('_trackPageLoadTime');

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')0; s.parentNode.insertBefore(ga, s);
})();
</script>

3. After a day or so, GA will start collecting measures and will produce metrics like below under Content > Site Speed

Related posts:

  1. Développez vos conversions grâce à la Google Analytics Conversion University
  2. Tracker les campagnes emailing avec Google Analytics
  3. Glossaire de l’analytics
  4. The famous Google PacMan page
  5. Ce qui a changé depuis le rachat d’Urchin par Google : pourquoi le modèle Google s’essoufle ?

One Comment

  1. Update: This “trackPageLoadTime” function is now deprecated. So even if it still works, Analytics now automatically tracks page load time (at a lesser sampling rate: 1% instead of 10% pageviews). In addition, I recommend to erase this line, as it seems to generate problems with some CDN.

Leave a Reply

*

Archives: Accord entre Warner Music et Dailymotion http://t.co/kUCbwOGE 18 hrs ago