To what extent does Google Analytics impact performance?
I'm looking for the following:
One (possible) method of testing Google Analytics (GA) on your site:
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?
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.
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.
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.
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.
"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.
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.
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.
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:
window.datalayer
gtag()
function that just pushes whatever you throw at it into that array.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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With