Home | Search Engine Optimization | Wordpress | Adding PageLoadTime to a WP Blog

Adding PageLoadTime to a WP Blog

John Doherty —  May 5, 2011
  • Buffer
  • Vote on Hacker News
  • Sharebar
  • Buffer
  • Vote on Hacker News

Recently a lot of talk has been going around SEO circles about the new Google Analytics ability to track the time it takes for your page to load.

Tom gave this little tidbit of help

I use WordPress for this site, and I got curious about how to add in the PageLoadTime part of the script using my WordPress Admin.

I have installed Google Analyticator on my site to help with the Analytics validation. It makes everything really easy. Here is how I added the PageLoadTime script to my site:

Easy Steps

Step 1: Log into your WordPress admin area.

Step 2: Navigate to Google Analyticator. It will be in your sidebar under “Settings -> Google Analytics”:

Step 3: Navigate down the page until you find “Additional Tracking Code (after Tracker Initialization)”:

 

You want the code after GA has initialized, so that the data is tracked.

Step 4: Enter this code into the box:

_gaq.push(['_trackPageLoadTime']);

Step 5: Look at your site to make sure it has entered correctly. Your tracking script should look thus:

The bottom line is the line of code we just added. My UA number is redacted.

*Note* Numbers will not start appearing in your Analytics right away. According to this post by Optimisation Beacon, data will begin appearing after a few hundred pageviews.

Wait, where do I find this in Analytics?

First, make sure you are using the NEW Analytics. I believe it has been rolled out to everyone.

You can find Site Speed on your site’s Analytics Dashboard under Content -> Site Speed. This is where it is, visually:

Happy optimizing!

Other articles about PageLoadTime

OptimisationBeacon

Webmaster Forum help page from Google

John Doherty

Posts

I'm the new (as of October 2013) Online Marketing Manager of Hotpads.com, soon to be based in San Francisco. Previous to Hotpads I worked at Distilled for 2 years as an online marketing consultant. In my spare time I shoot lifestyle photography, explore new and interesting food in New York, ski, rock climb, and update my Twitter and Google+ accounts.

13 responses to Adding PageLoadTime to a WP Blog

  1. Did this today – looking forward to seeing the results tomorrow morning. Got a feeling I’m going to be spending the day compressing stuff! Idea for your next post – reducing page load times for noobs!

  2. Wow, thats a great new feature! Thanks for the walkthrough on how to insert the code!

  3. Nice. Excited to give this a shot. When I add it to my analytics code (via Google Analytics for WordPress Configuration) and videw the source, I see:

    _gaq.push([\'_trackPageLoadTime\']);

    Do those extra \’s make a difference? Are they going to break the code?

    • John Doherty May 5, 2011 at 7:11 pm

      John –
      I don’t think it should have done that. You need to have exactly what I designated to put.

      I am honestly not sure how it works adding with Google Analytics. Is there an option for adding “After Initialization”? How did you input the code? I guess what I am asking is if there is a place provided to input custom code.

      • I put it in as you stated, but when I submit, it adds the slashes. I feel like I’ve seen this happen before in other instances.

        I removed Google Analytics for WordPress and installed Analyticator – that seemed to do the trick.

        Thanks again!

  4. Hi John,

    You’re using Yoast’s Google Analytics for WordPress, not Google Analyticator. That plugin seems to have a bug where the slashes are added but not stripped out.

    I have a post (How To Add Site Speed For Google Analytics In WordPress) that covers how to hack the plugin to fix this and I’ve also reported it as a bug.

    Hope that helps..

    • My bad, I didn’t see your post until after I uninstalled Yoast’s plugin. I think I’ll probably just stick with Analyticator, I have no real preference as long as the GA data is being gathered. Thanks for taking the time to share that though, I appreciate it!

  5. Good idea redacting your UA code!

    I forgot to do that and have had several sites showing up in my unfiltered profile… :(

    Luckily I’ve had it happen to me before, so I was prepared for it.

Trackbacks and Pingbacks:

  1. Google Analytics Now Tracks Page Load Speed | NexGen SEM - May 5, 2011

    [...] Adding page load speed code to a wordpress blog [...]

  2. Google Analytics Now Tracks Page Load Speed | jondyer.net - May 5, 2011

    [...] Adding page load speed code to a wordpress blog [...]

  3. Site Speed Report Now Available In Google Analytics | Wpromote - May 6, 2011

    [...] In order to begin monitoring site speed in Analytics, you need to add one line of code to your Analytics tracking code snippet. You can see how to do it here. If you run a WordPress blog, allow me to direct your attention here. [...]

  4. Google Analytics Now Tracks Page Load Speed | New Age Website Marketing - May 25, 2011

    [...] Adding page load speed code to a wordpress blog [...]