---
title: "Client-Side Performance Monitoring"
summary: "Studies at Google and Amazon have shown that even 100ms of extra load time can have a dramatic effect on your conversion rate. So how fast is your site?"
date: 2013-10-10
authors: [zack-bloom]
topics: [Frontend]
canonical: https://product.hubspot.com/blog/client-side-performance-monitoring
cover:
  scene: client-side-performance-monitoring
  alt: "A man hunched in his chair waits so long for a page that his beard pours to the floor and piles up in curls, while an orange stopwatch on the desk times the wait."
---

Studies at Google and Amazon have shown that even 100ms of extra load time can have a dramatic effect on your conversion rate.  So how fast is your site?

You can measure it on your computer using Chrome DevTools or YSlow, but how fast is it on your user's actual computer or mobile device?  It's not hard to find out.

## Manifesto

Now that the [APIs are available](https://dev.hubspot.com/blog/webkit-resource-performance), there is no reason to not be monitoring web app performance from the client. The data you get reflects the experiences of your actual users, not some artifical testing environment, and it doesn't require a complex virtualization environment.  In just a couple lines of code you will have powerful analytics you can use to optimize your site and to ensure your performance doesn't regress.

If you have a tool for monitoring client-side performance not listed here, please [let us know](mailto:zbloom@hubspot.com).

## Services and Tools

### Google Analytics

![Google Analytics User Timings report for the Home Page timing category, with timings such as Javascript Load Time at 8.12 seconds.](/assets/blog/client-side-performance-monitoring/file-336944458.webp)

Google Analytics provides [an API](https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingTiming) which can be used to manually track how long a javascript task takes.

For example, to track how long it took for an ajax request to complete:

```
var startTime = new Date;

$.ajax({
  url: 'some/url',
  success: function(){
    var elapsedTime = new Date - startTime;

    _gaq.push(['_trackTiming', 'some/url Load Time', elapsedTime]);
  }
});
```

Tracking all of the requests your page makes is possible by wrapping the `XMLHttpRequest` object.  It's also a good idea to use `performance.now()`, rather than `new Date`, when possible, and you'll need a way of turning urls into meaningful keys.  Take a look at a tool like [Bucky](http://github.com/HubSpot/BuckyClient) for a proven example.

### Caliper.io

![macbook](/assets/blog/client-side-performance-monitoring/file-338977707.png)

If you use Backbone.js or Ember, there is a paid service called [Caliper.io](http://caliper.io/) which can automatically measure the performance of parts of your app.

Caliper works by hooking into the routes your user navigates to and the events you bind onto views.  Whenever an event or route is triggered, it sends the time to the Caliper servers.

### New Relic

![New Relic Monitoring overview of browser page load time, averaging 1.68 seconds, with DOM processing its largest share.](/assets/blog/client-side-performance-monitoring/file-340253550.png)

New Relic is a paid service which can do general monitoring of your servers. Part of their offering is what they call '[Real User Monitoring](http://newrelic.com/real-user-monitoring)' which measures client-side performance.  Real User Monitoring is enabled by inserting a javascript file (or instructing New Relic to insert it for you).  Take a look at their [FAQ](https://docs.newrelic.com/docs/features/real-user-monitoring) for more detailed instructions.

### Bucky

![Time-series graph of six contacts.web.prod metrics from Bucky, such as page domInteractive and three hubapi request timings.](/assets/blog/client-side-performance-monitoring/file-337114033.png)

We at HubSpot built a tool to push performance data from the client into Statsd or OpenTSDB.  If you are using one of those tools to monitor your server-side performance, it might be a good idea to add [Bucky](http://github.hubspot.com/bucky) to monitor your client-side performance.

Drop one script tag in, and it will send data on every page load and AJAX request to your monitoring tool.  You can also manually monitor any javascript using Bucky.

Bucky is the only open-source and self-hosted service on the list, so far.
