Looking back at almost 20 years of history
Google Analytics, in its current form, is the result of constant and fascinating evolution. Its history dates back to 2005, the year of its launch by Google, although its roots are even older.
The Origins: Urchin Software Corporation
Before being called Google Analytics, the tool was known as Urchin. Google acquired Urchin Software Corporation in March 2005. This was the cornerstone upon which Google built what would become the world's most popular analytics service.
Google Analytics Launch (2005)
Just a few months after acquiring Urchin, Google launched Google Analytics. Demand was so high at the time that Google had to temporarily suspend new sign-ups shortly after launch.
Mass Adoption and Rapid Growth (2005-2010)
Google Analytics quickly became one of the most widely used website analytics tools. According to various studies, by 2010, it was used by approximately 50% of the 10,000 most popular websites worldwide.
Introduction of Universal Analytics (2012)
In 2012, Google introduced Universal Analytics, a major update. This allowed for better cross-platform integration and offered more personalized tracking capabilities, further strengthening Google's dominant position in web traffic analysis.
Continuous Evolution and Advanced Features (2010-2022)
Over the years, Google added numerous features to the Analytics tool, including mobile tracking, integration with AdWords and Search Console, and advanced reports on goals and conversions, ensuring even faster growth in the e-commerce segment.
Google Analytics 4 (2023)
Today, despite a widely criticized migration to GA4, Google Analytics dominates the web analytics market. According to BuiltWith figures, in 2023, Google Analytics is used by 63% of the 100,000 most visited sites, demonstrating its massive hold on the online analytics landscape.

This history demonstrates Google's ability to identify a market need, integrate it into its ecosystem, and develop it to meet the changing needs of webmasters, marketers, and business owners worldwide.
Performance issues with the tag provided by Google
Since the early incarnations of Google Analytics, Google has provided users with a JavaScript tag to enable tracking. At first glance, this seems logical: JavaScript is a universally accepted language, runs on virtually all browsers, and allows for complex interactions.
However, in terms of performance, this decision is not without consequences. Let's now look at what's wrong with how the Google Analytics tag works.
JavaScript Tag vs. Native Script
Until very recently (Universal Analytics), Google provided a JavaScript tag rather than a call relying on the native HTML <script> tag, which limited our ability to prioritize its loading. In the web world, prioritization is a crucial issue. Ideally, third-party scripts should be de-prioritized compared to first-party scripts.
/* Ancien script d'injection asynchrone Google Analytics */
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-XXXXXXXXXX', 'auto');
ga('send', 'pageview');
This prioritization ensures that the site's essential content and features are loaded and rendered first, providing a better user experience. A dynamic JavaScript injection tag like the one previously provided by Google offers no technical flexibility. Fortunately, things have changed with the introduction of GA4, which finally leverages HTML standards... while still maintaining its asynchronous behavior.
Async vs. Defer Loading
The tag provided by Google uses an "async" loading mechanism, meaning it is downloaded in parallel with the page rendering, in a non-blocking way, but it executes as soon as it's ready.

This is problematic because, although the script is loaded asynchronously, its execution can interrupt and block the page rendering. In its default implementation, the Google Analytics tag thus prevents pages from displaying quickly in many scenarios.
Google Tag Manager: An Extra Layer of Complexity
The fact that the Google Analytics 4 script is mandatorily encapsulated within a Google Tag Manager (GTM) container further exacerbates these issues. GTM generates "blocking time," requires connections to multiple third-party domains, leading to additional network latency, and ultimately delays the execution of the tracking code.
We end up in a scenario where GTM can block page rendering, but Google Analytics can also do so in turn since it is also executed asynchronously in its wake. The result is pages offering a degraded User Experience and exhibiting high TBT and INP metrics.
Google's Problematic Recommendation
Google advises placing its tag at the beginning of the <head> tag, which, from a performance perspective, is problematic. The beginning of the <head> is valuable real estate where resources essential for fast page rendering should be prioritized. Placing the Google Analytics tag here, especially without solid technical justification, is an invitation to performance issues.

Ultimately, while Google Analytics offers invaluable insights into traffic and user behavior, its standard implementation poses serious web performance challenges. For professionals keen on delivering fast and seamless web experiences while benefiting from Google's data, optimizing Google's offering is key. This is what we will explore now.
Optimizing the Google Analytics Tag Integration
Implementing a robust analytics solution like Google Analytics should not come at the expense of your site's performance. Fortunately, with a few technical tricks, it's possible to minimize its impact while retaining the tool's benefits. Here's how to optimize your integration.
Using a native <script> tag with 'defer' and 'fetchpriority'
Rather than relying on the default implementation, use a native <script> tag with the 'defer' attribute. This ensures your script does not block page rendering because, unlike 'async', 'defer' allows scripts to execute after rendering is complete.
To deprioritize it further, adding a fetchpriority="low" attribute indicates to the browser that this script is not crucial and can remain in the download queue as long as necessary. Here is an example of optimal code incorporating these two optimizations:
<!-- Google tag (gtag.js) -->
<script src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX" defer fetchpriority="low"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-XXXXXXXXXX');
</script>
Load the script at the bottom of the page, before </body>
For defer, much more so than for async, the order in which JavaScript resources are called matters. Even with a defer attribute, a script called in the <head> has a high chance of being executed before the scripts that follow it.
To be certain of deprioritizing Google Analytics, the code must therefore be placed at the very end of the page, just before the closing </body> tag. It should also be accompanied by all third-party scripts, except for the CMP, which requires higher prioritization.
Employ resource hints
To anticipate and optimize network connections to Google Analytics, you can use resource hints such as dns-prefetch and preconnect. These "resource hints" allow the browser to resolve domains and establish connections in advance, thus speeding up the process when the script is actually called.
<link rel="dns-prefetch" href="https://www.googletagmanager.com">
<link rel="dns-prefetch" href="https://www.google-analytics.com">
The code above allows you to anticipate the first connection step to the two domains required to load the Google Analytics script, which will then load with less latency.
Loading the script from your own domain
Another powerful approach is to serve the Google Analytics script directly from your domain. This can be accomplished via a proxy or through caching orchestrated by your CMS or a dedicated extension. In the WordPress ecosystem, many extensions offer such functionality, including the excellent WP Rocket.
By anticipating all or part of the 3 connection steps to an external domain (DNS resolution, initial connection, and SSL negotiation), you can save between 650 milliseconds and one second on a 3G+ connection, which is a significant gain in terms of network latency.
Deferring execution until user action
If your analytical needs allow, consider the possibility of delaying the execution of the Google Analytics script until a user interacts with your site, for example via a click, scroll, or keyboard input.
This ensures that the browser's resources are initially fully dedicated to rendering the page and activating its features. Data collection only occurs in a second execution window, once the user is ready to engage. Such behavior can easily be implemented in WordPress (WP Rocket, Perfmatters, FlyingPress…), but requires specific code elsewhere:
["keydown", "mousedown", "mousemove", "touchmove", "touchstart", "touchend", "wheel"].forEach(function(e) {
window.addEventListener(e, firstInteraction, {
once: true,
passive: true,
});
});
var userInteracted = false;
function firstInteraction(event) {
if (event && !userInteracted) {
let load_on_interaction = [
"https://www.googletagmanager.com/gtm.js?id=G-XXXXXXXXXX",
];
let head = document.getElementsByTagName("head")[0];
load_on_interaction.forEach(function(e) {
var script = document.createElement("script");
script.setAttribute("src", e);
script.setAttribute("defer", "defer");
script.setAttribute("fetchpriority", "low");
head.appendChild(script);
});
userInteracted = true;
}
}
Ultimately, although Google Analytics is a powerful tool, it is essential to approach its integration with a keen eye on performance. If this seems too complex, perhaps you will find a solution that meets your needs among the competition.
Is your site as fast as your visitors expect?
Less performance-impacting alternatives
Tracking user behavior on a website is essential for understanding interactions and optimizing the user experience. Although Google Analytics is widely used, it is far from the only solution available. There are alternatives that offer advantages in terms of privacy and performance.
Why are these alternatives paid?
The costs associated with collecting, processing, and storing tracking data are high. Supporting thousands, or even millions, of network requests daily requires a cutting-edge server infrastructure that is robust and scalable.
Unlike Google, which monetizes its services by exploiting data for advertising purposes, many other analytics players opt for a directly paid model to fund their infrastructure and ensure user privacy.
Matomo and Plausible Analytics: Major Players
Matomo
Formerly known as Piwik, Matomo is an open-source web analytics platform that offers a serious alternative to Google Analytics. While providing a rich set of features, Matomo emphasizes privacy and data control.
Plausible Analytics
Newer to the market but very promising, Plausible stands out for the lightness of its tag, weighing only 1 KB. This has a direct impact on performance, as a lighter tag means less Blocking Time, less bandwidth usage, and therefore improved Core Web Vitals metrics like TBT (Total Blocking Time) and INP (Input Delay).

You probably haven't noticed, but the current page, for example, loads Plausible Analytics synchronously while benefiting from a mobile PageSpeed Insights score of 100%.
Privacy and Regulatory Advantages
Another major advantage of Plausible is its GDPR compliance. It does not use cookies and does not collect personal data without consent. This means that with Plausible, there is no need to install a CMP (Consent Management Platform).
CMPs are not only a privacy concern, but they are also often heavy and they generate "Blocking Time". By removing the need for a CMP, we achieve a clear performance improvement.
The issue of alternatives has been raised and discussed; now we need to address the issue from a broader perspective: Google Analytics is unfortunately just one example among many others.
Beyond Google Analytics: The Challenge of Third-Party Scripts
Google Analytics is just the tip of the iceberg when it comes to managing web performance with third-party scripts. Whether for advertising, user behavior analysis, cookie consent, or A/B testing, these scripts can quickly pile up and impact the user experience. Here’s how to tackle this challenge.
Prioritization: a universal request from third-party scripts
Most third-party script providers recommend placing their tags as early as possible in the page lifecycle. Whether for tracking efficiency or user interaction, this logic may seem sound from their perspective. But this prioritization can become problematic.
The essential: the page itself
In the rush to add features and analytics, it’s easy to forget that the heart of any website is the page itself. First-party scripts, those that are an integral part of your site and enable the user interface to function (dropdown menus, sliders, accordions, etc.), should be the true stars of the show.
Delay to prioritize: the real challenge
The trick, therefore, is to re-prioritize first-party scripts by delaying the execution of third-party scripts. This is not only logical, it is also beneficial for the user experience.
By focusing on the elements that truly make up your site’s content and functionality, you can significantly improve key metrics like FCP (First Contentful Paint) and LCP (Largest Contentful Paint).
Minimal impact on third-party scripts
By combining this de-prioritization of third-party scripts with other optimizations, you can achieve a balance where nothing is lost in terms of third-party tool functionality.
Indeed, the performance gain in FCP and LCP largely compensates for any delay these scripts might experience, knowing that the range we’re talking about is generally 500 milliseconds at most.
The importance of a global vision
The challenge posed by Google Analytics and other third-party scripts requires a global vision. Instead of prioritizing each tool in isolation, a holistic approach that considers the entire site and user experience is not only possible but also essential.
By adopting this philosophy, you can leverage the benefits of analytics and marketing tools without sacrificing web performance and user engagement.
The balance between performance and insights
In the digital age, where ease of integration and the variety of available tools can be tempting, it is tempting to layer functionality upon functionality on our websites. One tag here for user behavior tracking, another there for targeted advertising; and before you know it, your site's performance has been compromised.
The hidden cost of third-party features
The addition of each new feature, however appealing, must be considered in terms of its impact on performance. With every tag you add to your site, you also take on the risk of adding load time, network latency, and increasing CPU resource consumption.

The question to ask is not only whether a tool adds value, but also whether it justifies the cost in terms of web performance.
Rigorous monitoring for effective management
In the heat of the moment and the tumult of daily operations, tools that were once essential can quickly become obsolete or duplicated. Development teams are not always aware of changes in the needs or priorities of marketing or SEO departments, leading to the persistence of unused scripts that drag down performance.
Close monitoring, using detailed web performance metrics, can highlight these imbalances and offer immediate performance gains when removing redundant or unnecessary tools. These are issues often discussed with our clients as part of our performance monitoring services.
The keywords: 'forward-thinking' and 'collaboration'
It is not enough to think about adding new features; it is equally crucial to plan for their maintenance and, eventually, their removal. This requires close collaboration between development, marketing, and SEO teams.
Forward-thinking consideration of the tools to integrate and their impact on performance can prevent problems before they arise, thus ensuring that your site remains performant, current, and aligned with your long-term business objectives.
Ultimately, the goal is to find a balance between collecting useful insights and maintaining a high-performing website. And this balance is only possible if every addition, every modification, is made thoughtfully and in close collaboration among all stakeholders.
In this delicate game, performance and insight are not enemies, but partners that, when managed well, can coexist harmoniously.