---
title: "Add Google Analytics to Joomla - Tassos Code Snippets"
description: "Your Joomla website gets traffic every day, but you have no idea where visitors come from, what they do, or how long they stay. Without tracking in pl"
url: "https://www.tassos.gr/docs/tassos-code-snippets/howto/analytics-tracking/google-analytics"
date: "2026-04-05T12:26:09+00:00"
language: "en-GB"
---

[ Home ](https://www.tassos.gr/index.php?option=com_content&view=category&layout=blog&id=24&Itemid=1088) / [ Tassos Code Snippets ](https://www.tassos.gr/index.php?option=com_content&view=category&id=120) / [ How-to Guides ](https://www.tassos.gr/index.php?option=com_content&view=category&id=125) / [ Analytics &amp; Tracking ](https://www.tassos.gr/index.php?option=com_content&view=category&id=140)

#  Add Google Analytics to Joomla

Your Joomla website gets traffic every day, but you have no idea where visitors come from, what they do, or how long they stay. Without tracking in place, you're making decisions based on gut feeling instead of data. Adding Google Analytics to Joomla is the fix, and you don't need a dedicated plugin. You can add Google Analytics to your Joomla site using Tassos Code Snippets.

## [Get the Google Analytics Measurement ID](#get-the-google-analytics-measurement-id)

You need a Google Analytics account and a GA4 property. If you haven't set one up yet, follow these steps.

1. Go to [Google Analytics](https://analytics.google.com/) and sign in.
2. Click the **Admin** gear icon in the bottom-left corner.
3. Under **Property**, click **Data Streams**.
4. Click on your website's data stream.
5. Copy the **Measurement ID** (it starts with `G-`). You'll need this in the next step.

## [Install Google Analytics in Joomla](#install-google-analytics-in-joomla)

Google Analytics is a piece of code you add to the header section on every page of your Joomla website. To install it, follow the steps below:

1. Install [Tassos Code Snippets](https://www.tassos.gr/docs/tassos-code-snippets/getting-started/how-to-install) if it is not installed already.
2. Go to the Joomla Administrator.
3. Open Components -&gt; Tassos Code Snippets.
4. Click New.
5. Give your snippet a descriptive title like "Google Analytics Tracking".
6. Select **HTML** snippet type.
7. Paste the following code, replacing `G-XXXXXXXXXX` with your actual Measurement ID: ```
    <!-- Google tag (gtag.js) -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());
      gtag('config', 'G-XXXXXXXXXX');
    </script>
    ```
8. Select **Site Header** as the **Insertion Method**.
9. Publish the snippet.

Congrats! You've successfully added Google Analytics to your Joomla site without installing another plugin.

## [Verify it Works](#verify-it-works)

After publishing the snippet, visit your website to trigger a page view. Then open your Google Analytics account and go to Reports → Realtime. If you see an active user, the tracking code is working correctly. If nothing shows up, wait a minute and refresh, or check that the snippet is published and set to Site Header.

 Last updated on Mar 25th 2026 13:03

## Schema

```json
{
    "@context": "https://schema.org",
    "@type": "BreadcrumbList",
    "itemListElement": [
        {
            "@type": "ListItem",
            "position": 1,
            "name": "Home",
            "item": "https://www.tassos.gr"
        },
        {
            "@type": "ListItem",
            "position": 2,
            "name": "Home",
            "item": "https://www.tassos.gr/docs"
        },
        {
            "@type": "ListItem",
            "position": 3,
            "name": "Tassos Code Snippets",
            "item": "https://www.tassos.gr/docs/tassos-code-snippets"
        },
        {
            "@type": "ListItem",
            "position": 4,
            "name": "How-to Guides",
            "item": "https://www.tassos.gr/docs/tassos-code-snippets/howto"
        },
        {
            "@type": "ListItem",
            "position": 5,
            "name": "Analytics & Tracking",
            "item": "https://www.tassos.gr/docs/tassos-code-snippets/howto/analytics-tracking"
        },
        {
            "@type": "ListItem",
            "position": 6,
            "name": "Add Google Analytics to Joomla",
            "item": "https://www.tassos.gr/docs/tassos-code-snippets/howto/analytics-tracking/google-analytics"
        }
    ]
}
```

```json
{
    "@context": "https://schema.org",
    "@type": "Article",
    "mainEntityOfPage": {
        "@type": "WebPage",
        "@id": "https://www.tassos.gr/docs/tassos-code-snippets/howto/analytics-tracking/google-analytics"
    },
    "headline": "Add Google Analytics to Joomla",
    "image": {
        "@type": "ImageObject",
        "url": "https://www.tassos.gr/"
    },
    "publisher": {
        "@type": "Organization",
        "name": "Tassos",
        "logo": {
            "@type": "ImageObject",
            "url": "https://www.tassos.gr/https://www.tassos.gr/media/brand/logo-text.png"
        }
    },
    "author": {
        "@type": "Person",
        "name": "Tassos Marinos",
        "url": "https://www.tassos.gr/docs/tassos-code-snippets/howto/analytics-tracking/google-analytics"
    },
    "datePublished": "2026-03-25T13:49:40+02:00",
    "dateCreated": "2026-03-25T13:49:40+02:00",
    "dateModified": "2026-03-25T13:53:10+02:00"
}
```
