Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Google Analytics have performance overhead?

To what extent does Google Analytics impact performance?

I'm looking for the following:

  • Benchmarks (including response times/pageload times et al)
  • Links or results to similar benchmarks

One (possible) method of testing Google Analytics (GA) on your site:

  1. Serve ga.js (the Google Analytics JavaScript file) from your own server.
  2. Update from Google Daily (test 1) and Weekly (test 2).

I would be interested to see how this reduces the communication between the client webserver and the GA server.

Has anyone conducted any of these tests? If so, can you provide your results? If not, does anyone have a better method for testing the performance hit (or lack thereof) for using GA?

like image 733
M.N Avatar asked Jan 12 '09 12:01

M.N


People also ask

Does Google Analytics impact performance?

Google hurts the performance score by roughly 4%, and we almost have zero impact (0.1%). If you care about a fast website and are still using Google Analytics, this could be a good moment to switch.

Is Google Analytics a performance measurement tool?

Google Analytics has quickly become the industry standard for tracking the performance of your website. GA is a website data tool to help you measure what drives visitors to the site, what content performs, understand traffic sources and how your digital marketing is performing.

Does Google Analytics affect website performance?

Analytics tools do impact performances on websites. They usually add a script to the website that adds functionality. Logically this has a cost in terms of performance. Some analytics businesses care a lot about this, and others don't have that high priority.

Is there a server side overhead for Google Analytics?

There's no/minimal site overhead on the server side. The HTML for Google Analytics is three lines of javascript that you place at the bottom of your webpage. It's nothing really, and doesn't consume any more server resource than a copyright notice.

Will using Google Analytics affect the appearance of my website?

"The appearance of your website will never be affected by your use of Google Analytics - we don't place any images or text on your pages. Likewise, the performance of your pages won't be impacted, with the possible exception of the very first page-load after you have added the tracking code.

Does Google Analytics add to website load time?

If you use Google Analytics properly, it will load after the page has shown to the user. So yes, it will add a small overhead to every request but because the user can see the page already they probably won't even notice. Just go for it.

Is Google Analytics slowing your site down?

Google Analytics Code is Slowing Down My Site Fast page load times are vital for websites. Users have a notoriously short attention span, and visitors will leave if a site takes more than a few seconds to load. When Google Analytics was first released in 2005, slowness caused by the Google Analytics Tracking Code (GATC) was common.


1 Answers

2018 update: Where and how you mount Analytics has changed over and over and over again. The current gtag.js code does a few things:

  1. Load the gtag script but async (non-blocking). This means it doesn't slow your page down in any other way than bandwidth and processing.
  2. Create an array on the page called window.datalayer
  3. Define a little gtag() function that just pushes whatever you throw at it into that array.
  4. Calls that with a pageload event.

Once the main gtag script loads, it syncs this array with Google and monitors it for changes. It's a good system and unlike the previous systems (eg stuffing code in just before </body>) it means you can call events before the DOM has rendered, and script order doesn't really matter, as long as you define gtag() first.

That's not to say there isn't a performance overhead here. We're still using bandwidth on loading up the script (it's cached locally for 15 minutes), and it's not a small pile of scripts that they throw at you, so there's some CPU time processing it.

But it's all negligible compared to (eg) modern frontend frameworks.

If you're going for the absolute, most cut-down website possible, avoid it completely. If you're trying to protect the privacy of your users, don't use any third party scripts... But if we're talking about an average modern website, there is much lower hanging fruit than gtag.js if you're hitting performance issues.

like image 164
Oli Avatar answered Sep 19 '22 10:09

Oli