Login · Register
Home About Blog

Landing Page Load Time Analysis

With the new qualitly scores taking into account how fast your landing page loads, it is increasingly more important to build faster loading landing pages. And to analyze that we have a simple script, the same one we use on Prosper202.com (see below) that displays at the bottom of each page: how long it took to load. Below is the script that shows how to set this up.

Landing Page Code

<? $microtimer microtime();  /*set the timer, this is to be placed at the top! */  ?>

<html>
    <head>
        <title>Title</title>
    </head>
    <body>
    
        Blah Blah Blah, this is my content!
        
        <? //print on the screen how long this page to took to load
        
$seconds =  microtime() - $microtimer;
        echo 
'This page took ' round($seconds,3) . ' seconds to load.'?>
    
    </body>
</html> 

Conclusion

So now at the bottom of each page it will say: This page took xxxxx seconds to load.

Responses

  1. Craig Mullins on Oct 27, 2008 at 10:52pm

    Now we just need to set up a mysql database for logging various times of the day & to see how fast it loads for people in other areas

  2. Wes (MasterlessSamurai,cin on Nov 24, 2008 at 10:28am

    question...

    does this have to be above the opening HTML elements or is there another way we could use it? I read this article about IE6 breaking when anything is on the first line before the doctype declaration.

    [url=http://www.communitymx.com/content/article.cfm?page=2&cid=E2F258C46D285FEE]http://www.communitymx.com/content/article.cfm?page=2&cid=E2F258C46D285FEE[/url]

    i verified...my page doesnt fully validate when i have this code.

  3. Wes Mahler on Nov 24, 2008 at 7:55pm

    It is PHP code, it is displayed above the HTML, it won't break, because the PHP code isn't rendered.

  4. primesgenato on Jan 11, 2009 at 2:38am

    Take note boys and girls. This script doesn't really do what you think.

    Load time as needed by google is the time it takes for the LP to load on the CLIENT side, i.e. the browser, and NOT the time for the LP to be generated on the SERVER side.

    Since this script uses php, then the "microtime()" function actually runs on the server and not on the user's browser. So this script's time is how long the SERVER took to generate the LP's html code. It's not the time to load the ACTUAL LP IN THE USER'S BROWSER. This means that image, audio, video and other large media files are NOT INCLUDED in the timing! The script only calculates the time to generate the html line, e.g. "<img> ... </img>" for images. So a LP with a crazy 100GB image will have the same load time as a similar LP with a 100KB image, using this script!

    A javascript or other client-side solution should do the trick. There should be working code freely available for this. Try doing a search for javascript page load timer, or something similar.

  5. primesgenato on Jan 11, 2009 at 9:28pm

    I also noticed that all pages in your prosper202.com domain display the load time at the bottom, "This page took 0.xxx seconds to load." Presumably it's also using this script. ;)

    BTW, a little off topic. I've recently been trying out prosper202 and I'm LOVING it so far. I had to code my own tracking system a few years ago because there weren't any available then. It's been serving me well but I've been hearing lotsa good stuff about prosper202, so I decided to check it out a few days ago. Very slick product! I think I may start transferring all my campaigns over to prosper202 soon. :)

  6. Clint Lenard on Jan 21, 2009 at 9:18pm

    Primesgenato is actually correct, from what I have always understood. Since it's Server side, it's timing the actual response time for how fast PHP is being rendered, not the HTML.

    Now, what it COULD be useful for is for Dynamic Pages, although, again, HTML will not be added to the total time. So, bad coding and Design (images, etc) could make this code 100% obsolete in Google's eyes, as they're loading the entire code (HTML).

  7. david on Feb 28, 2013 at 10:33pm

    since prosper202 was redesigned, has there been any improvements with this code or have you placed anything like it inside of prosper202 so we dont need this anymore?

Leave a Reply

Name (required)

Email (will not be published) (required)

Website

What does 4 + 4 equal? (required spam filter)


Creative Commons License This work (Prosper202, Tracking202 and Export202) is licensed under a
Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.