Google Analytics
Free web analytics service by Google tracking website traffic, user behavior, conversions, and audience demographics. Used by 55M+ websites.
Websites Using Google Analytics
What Is Google Analytics?
Google Analytics is a free web analytics service from Google that records how people find, browse, and convert on a website. For roughly two decades it has been the most widely deployed analytics platform on the planet, and a measurement tag of one Google Analytics generation or another still appears on the large majority of sites that use any analytics at all. According to W3Techs, Google's analytics products are detected on more than half of all websites and hold around an 80 percent share of the analytics-tools market, which makes "is there a Google Analytics tag on this page?" one of the first questions any technology lookup tends to answer.
The important nuance in 2025 is that "Google Analytics" is not one product. The original platform, retroactively named Universal Analytics, stopped processing new data on 1 July 2023 (standard properties) and was fully shut down for the remaining 360 properties in July 2024. It was replaced by Google Analytics 4 (GA4), an event-based redesign. As a result, when StackOptic or any other tool reports "Google Analytics" today, it almost always means a GA4 tag, frequently delivered through Google Tag Manager. You will still find historical Universal Analytics signatures in archived pages, abandoned sites, and old documentation, which is exactly why understanding the legacy footprint still matters when you audit a site.
This page covers the Google Analytics family as a whole: how the tag loads, the difference between the legacy and current implementations, and most importantly the concrete signals you can use to detect it yourself. If you want to go deeper on the current version specifically, see our dedicated profile on Google Analytics 4.
How Google Analytics Works
At its core, Google Analytics works by loading a small JavaScript library that watches activity in the browser and sends "hits" or "events" to Google's collection servers. The page owner pastes a snippet into the site once, and from then on every page load fires a measurement request containing the page URL, referrer, screen size, language, a client identifier, and—depending on the version—a stream of interaction events.
The mechanics differ sharply between generations, and recognizing the difference is the key to accurate detection.
Legacy Universal Analytics evolved through three libraries. The earliest was urchin.js, replaced by the synchronous and then asynchronous ga.js, and finally by analytics.js. Universal Analytics properties used a UA-XXXXXX-Y tracking ID (for example UA-123456-1), and the tag sent page views to the endpoint https://www.google-analytics.com/collect using the Measurement Protocol v1. The library set first-party cookies—most recognizably _ga, along with _gid and _gat—to stitch together sessions and distinguish returning visitors.
Google Analytics 4 uses a single global site tag, gtag.js, loaded from https://www.googletagmanager.com/gtag/js?id=G-XXXXXXX. GA4 properties use a G-XXXXXXX measurement ID instead of a UA ID. Instead of session-and-pageview hits, GA4 streams discrete events to https://www.google-analytics.com/g/collect (and increasingly to region-specific or server-side endpoints). GA4 keeps the _ga cookie for the client ID but adds a per-property cookie named _ga_<CONTAINER-ID> that stores session state.
In both eras, many sites do not embed the analytics library directly. Instead they load Google Tag Manager, and GTM injects the analytics tag at runtime. This indirection is one reason a quick glance at the HTML source sometimes shows only a GTM container even though analytics is clearly running—the analytics request appears only after GTM executes. Our guide on how to check if a website uses Google Tag Manager explains that relationship in detail.
A further wrinkle is that GA4 itself can be deployed in two distinct ways: with the standalone gtag.js library hard-coded onto the page, or as a GA4 configuration tag living inside a Google Tag Manager container. Both produce the same /g/collect requests and the same G- measurement ID, but the first is visible in the page source while the second is not. This is precisely why experienced auditors never declare a site "analytics-free" on the strength of source view alone—the absence of a hard-coded library proves nothing when a tag manager could be injecting one. The dependable confirmation is always the live collection request observed in the browser's Network tab.
How to Tell if a Website Uses Google Analytics
This is the practical heart of the matter. There are several independent detection signals, and the most reliable audits confirm at least two of them. Here is how to check, ordered roughly from quickest to most definitive.
1. View the page source. Right-click and choose "View Page Source" (or press Ctrl+U / Cmd+Option+U) and search the HTML for tell-tale strings:
googletagmanager.com/gtag/js?id=G-indicates a GA4 tag.gtag('config', 'G-XXXXXXX')confirms a GA4 measurement ID.UA-followed by digits, or references toanalytics.js,ga.js, orurchin.js, indicate legacy Universal Analytics.- A
dataLayerarray near the top of the page hints that Google Tag Manager is orchestrating the tag.
Source view only shows what arrives in the initial HTML, so a tag injected later by GTM may not appear here. That is why the network tab is the gold standard.
2. Inspect network requests in Chrome DevTools. Open DevTools (F12 or Cmd+Option+I), go to the Network tab, type collect or google-analytics into the filter box, and reload the page. Watch for:
- A request to
google-analytics.com/g/collect(GA4) or/collect(Universal Analytics). - A query parameter
tid=G-XXXXXXX(GA4) ortid=UA-XXXXXX-Y(Universal Analytics) inside that request—this reveals the exact property ID. - The
gtag/js?id=G-script download itself.
Because these requests fire even when the tag is injected by GTM, the Network tab catches implementations that source view misses.
3. Check cookies. In DevTools, open Application → Storage → Cookies and look for the _ga cookie. The presence of _ga plus a _ga_<CONTAINER-ID> cookie is a strong indicator of GA4; _ga alongside _gid and _gat leans toward a Universal Analytics or transitional setup. Note that consent-gated sites may set these cookies only after the visitor accepts tracking.
4. Use the Console. Type dataLayer and press Enter to inspect the Tag Manager data layer, or type ga / gtag to see whether those global functions are defined. A defined gtag function is a clear GA4 signal.
5. Run curl for headers and HTML. curl -sL https://example.com | grep -i "gtag\|analytics\|UA-" quickly greps the server-rendered HTML for analytics signatures without a browser. Remember that curl does not execute JavaScript, so it confirms only what is hard-coded in the markup.
6. Use detection extensions. Browser tools such as Wappalyzer, BuiltWith, and the official Google Tag Assistant identify Google Analytics and report the property type. They are convenient, but they can lag behind GTM-injected tags or miss server-side implementations—so treat them as a starting point and verify with the Network tab. Google Tag Assistant is especially useful here because it connects to the page in a debug session and lists each tag, its measurement ID, and whether it fired successfully, which removes much of the guesswork that generic detectors leave behind.
When you combine these signals, the picture usually resolves quickly. A G- ID in source plus a /g/collect request plus a _ga_<CONTAINER-ID> cookie is an airtight GA4 verdict. A UA- reference with no live collection request is a dormant legacy fragment. And a GTM container with a GA4 request firing afterward tells you the analytics is managed through Tag Manager. Reading these combinations, rather than any single clue, is what makes a detection reliable.
Server-side detectors like StackOptic combine these HTML and network signals automatically when you analyze a URL. For a broader walk-through of identifying any measurement tool, our article on how to find out what analytics a website uses is the companion read, and the version-specific how to tell if a website uses Google Analytics 4 drills into GA4 fingerprints.
Key Features
Across its generations, Google Analytics provides a deep, free feature set that explains its dominance:
- Audience reporting covering demographics, geography, device, browser, and new-versus-returning visitors.
- Acquisition reporting that attributes traffic to channels such as organic search, paid ads, social, referral, and direct.
- Behavior and engagement metrics including page views, engaged sessions, average engagement time, and scroll tracking.
- Conversion and e-commerce tracking for goals, transactions, revenue, and multi-step funnels.
- Event-based measurement (GA4) where every interaction is an event with custom parameters.
- Cross-platform measurement (GA4) that unifies web and app data in a single property.
- Free BigQuery export (GA4) for raw event-level analysis in SQL.
- Native integration with Google Ads, Search Console, Looker Studio, and Tag Manager.
Pros and Cons
| Pros | Cons |
|---|---|
| Free at the scale most sites need | Steeper learning curve, especially GA4's event model |
| Enormous documentation and community knowledge | Sampling and data thresholds can blur low-volume reports |
| Deep Google Ads and Search Console integration | Privacy scrutiny under GDPR; needs consent management in the EU |
| Cross-platform web + app measurement (GA4) | Data is processed on Google's servers, not self-owned |
| Free BigQuery export for raw data (GA4) | Universal Analytics data is gone, complicating year-over-year history |
Google Analytics vs Alternatives
Google Analytics competes with privacy-focused tools, product analytics suites, and self-hosted platforms. The right choice depends on whether you prioritize cost, data ownership, depth of product analytics, or simplicity.
| Tool | Model | Data ownership | Best for |
|---|---|---|---|
| Google Analytics 4 | Event-based, cloud | Google-hosted | Broad web + app analytics, Ads integration |
| Matomo | Session + event, self-host or cloud | Full (self-hosted) | Data sovereignty and GDPR control |
| Mixpanel | Event-based, cloud | Vendor-hosted | Product analytics, funnels, retention |
| Plausible | Aggregate, privacy-first | Vendor or self-host | Lightweight, cookieless basic metrics |
Teams that need full data ownership or strict EU compliance often pair or replace Google Analytics with Matomo, while product teams seeking deep funnel and retention analysis lean toward Mixpanel.
Common Use Cases
- Marketing attribution: connecting ad spend and campaigns to on-site behavior and conversions.
- Content performance: identifying which pages and posts attract and engage visitors.
- Conversion optimization: measuring funnels, drop-off points, and goal completions.
- Audience research: understanding device mix, geography, and acquisition channels.
- Competitive and technical audits: confirming which analytics stack a site runs, often as part of a wider review of the full technology a website uses.
- Migration verification: confirming a clean cutover from Universal Analytics to GA4.
Frequently Asked Questions
Is Universal Analytics still working in 2025?
No. Universal Analytics stopped processing new data on 1 July 2023 for standard properties, and the last extended properties were turned off in July 2024. Any "Google Analytics" tag still collecting data today is GA4. You may still see Universal Analytics signatures (UA- IDs, analytics.js) in old or unmaintained pages, but they are no longer sending usable data to Google.
How can I tell which version of Google Analytics a site uses?
Check the property ID. A G-XXXXXXX ID, a gtag/js?id=G- script, or requests to /g/collect mean GA4. A UA-XXXXXX-Y ID or references to analytics.js and ga.js mean the now-defunct Universal Analytics. The DevTools Network tab is the most reliable place to read the ID from the tid parameter.
Why do I see Google Tag Manager but no Google Analytics in the source?
Because Tag Manager injects the analytics tag at runtime rather than hard-coding it in the HTML. Open the Network tab and reload; you will see the GA4 request fire after GTM executes even though "View Source" showed only the dataLayer and the GTM container.
Does Google Analytics work without cookies?
GA4 is designed to function with reduced cookie availability and uses modeling to fill gaps when visitors decline consent, but it still sets the _ga and _ga_<CONTAINER-ID> first-party cookies by default. On consent-gated sites those cookies—and the collection requests—may not appear until the visitor accepts tracking.
Can I detect Google Analytics with curl?
Partially. curl -sL <url> returns the server-rendered HTML, so you can grep for gtag, G-, or UA- strings that are present in the markup. Because curl does not run JavaScript, it will miss tags injected by Google Tag Manager. For those, use a browser's Network tab or a server-side analyzer that renders the page.
Want to know exactly which analytics tags, version IDs, and trackers a site runs? Analyze any URL free at https://stackoptic.com.
Alternatives to Google Analytics
Compare Google Analytics
Analyze a Website
Check if any website uses Google Analytics and discover its full technology stack.
Analyze Now