I work for a company that has a website with incredibly slow page load speed. (The average for the site is around 8 seconds). We use GA for our analytics so for a person to register as a bounce the site must fully load the page. Obviously lots of people will be bouncing in that time before it loads, is there a way to see how many people leave during this time or at least an estimate of how much data we might be missing?

To clarify:

  • I'm not able to make any changes to the websites code

  • The business seems blissfully unaware of the issues caused by the page load and I want some estimated impact numbers to light a fire under them

  • Where is this website hosted? on a buisness cable connection, or a web host provider (like godaddy). And if this buisness has a database running for commerce, or other database interaction, how many simultaneous users are accessing the server?
    – drtechno
    Commented May 14, 2018 at 16:24
  • Do you have access to web server logs? Commented May 15, 2018 at 13:15
  • Not currently but I may be able to request access to them
    – Jon.G
    Commented May 15, 2018 at 13:33
  • 8 seconds to load the entire website or 8 seconds "time to first byte"?
    – Matthew C
    Commented May 15, 2018 at 14:25
  • Give us website URL, I'll have a look.
    – Matthew C
    Commented May 15, 2018 at 14:26

2 Answers 2


Simply move the Google Analytics JS code to the start of the head section. It will be the frist resource to be loaded, parsed and executed by the web browser before the rest (stylesheets, other JS files, images, fonts etc.) of the slow page loads. GA can also track page load time so that's why you put it at the start of the head section.

Also, you can write your own JavaScript code and use the 'onbeforeunload' event.

window.onbeforeunload = function(e) {
  //Make AJAX call to the server to notify the user left.
  return null;

Again, put that JS code at the start of the head section of your website. This solution will work as long as the user doesn't leave too quickly, i.e. HTML code needs to load first (should be fraction of second like 0.3 and the user wouldn't leave that fast anyway).

You can also play around with Server Connection Handling. If your site is using PHP, have a look at PHP Connection Handling. ABORTED and TIMEOUT status might work for you.

  • 1
    However, in the long run, you must improve page loading times.
    – Matthew C
    Commented May 14, 2018 at 16:31
  • If the 8 seconds is typically waiting for "time to first byte", the users may give up before getting any of the head section. Commented May 15, 2018 at 13:18
  • He did not say 8 seconds waiting for "time to first byte". I assume it's 8 seconds to load the entire website. If it's 8 second waiting for "time to first byte" the it's time to change the hosting provider.
    – Matthew C
    Commented May 15, 2018 at 14:24

If you have lots of traffic on a shared web server (like 40-50 simultaneous users on a database) then you need to expand your web site horizontally.

This kind of upgrade, requires you to lease an infrastucture called a cdn server service. This load balances your site by virtual copies across hundreds or even thousands of servers, so that the closest connection from the web user get served by a cdn server instead of the main site. One of these CDN servers like this is called stackpath.

  • While this offers a possible solution to the slow load times, it doesn't answer the main question of how to measure what they are missing out on. It sounds like it is going to be hard to convince their company to spend money or make changes until the problem can be quantified. Commented May 15, 2018 at 13:17
  • There are a lot of variables there steve. From the type of webhosting, connections, server load etc. If this is a vps style web hosting, it would seem that a CDN would be a logical solution. Please don't down things arbitrarily when the op doesn't give us the whole picture @StephenOstermiller
    – drtechno
    Commented May 15, 2018 at 13:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.