---
title: "Adding Google Analytics to your Channel"
url: "https://support.sardius.media/knowledge-base/adding-google-analytics-to-your-channel"
category: "Channels"
updated: 2026-11-07
summary: "Overview You can connect Google Analytics to your Sardius channel in one of two ways. Which one works for you depends on whether your channel supports a cookie banner, so start by checking that in Step 1. Method Where you add it Cookie banner needed? Best for Google Analytics GA4 ID field Channel…"
---

# Adding Google Analytics to your Channel

## Overview

You can connect Google Analytics to your Sardius channel in one of two ways. Which one works for you depends on whether your channel supports a cookie banner, so start by checking that in Step 1.

| Method                        | Where you add it                                    | Cookie banner needed? | Best for                                                                               |
| ----------------------------- | --------------------------------------------------- | --------------------- | -------------------------------------------------------------------------------------- |
| Google Analytics GA4 ID field | Channel Settings > Social > Google Analytics GA4 ID | Yes                   | Channels with cookie banner settings, especially those serving viewers in GDPR regions |
| Custom script                 | Channel Settings > Social > Custom Head Content     | No                    | Channels with custom layouts without cookie banner settings                            |

**Important:** Use only one method per channel. Using both can block tracking or count visits twice.

## Before You Begin

Make sure you have the following ready:

- **Access to the Sardius Control Panel** at [cp.sardius.media](https://cp.sardius.media) with permission to edit your channel's settings.
- **Your Google Analytics 4 Measurement ID** (the ID that tells Google which property to send data to). It starts with `G-`, for example `G-XXXXXXXXXX`. You can find it in Google Analytics under Admin > Data Streams > select your web stream.
- **For Option 2 only:** the full Google tag (gtag.js) script from that same Data Stream page, under View tag instructions > Install manually.

## Step 1: Check Whether Your Channel Supports a Cookie Banner

Cookie banner support decides which option will work for your channel, so check this first.

1. Log into [cp.sardius.media](https://cp.sardius.media), go to **Channels**, and select your channel.

2. In the left menu, click **Customize Channel**.

3. Under **your layout**, click **Features**.

   ![Customize Channel page with the Features option highlighted under Default Experience](https://support.sardius.media/kb-media/7801932acb90f49b9c71.png)

4. Look for **Cookie Banner Settings** in the list.

   ![Cookie Banner Settings panel with Enable Banner switched on, button text fields, and color options](https://support.sardius.media/kb-media/c57e4a463a7925671ab6.png)

| What you see                              | What it means                                         | Next step                                                                                                                                  |
| ----------------------------------------- | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| **Cookie Banner Settings** is in the list | Your channel supports a cookie banner                 | Switch on **Enable Banner**, click **Update**, then go to [Option 1](#option-1-add-your-google-analytics-id-channels-with-a-cookie-banner) |
| No **Cookie Banner Settings**             | Your channel's layout doesn't support a cookie banner | Skip to [Option 2](#option-2-add-a-custom-google-analytics-script-channels-without-a-cookie-banner)                                        |

**Tip:** While you're in Cookie Banner Settings, you can also change the button text (for example **Accept** and **Only Use Necessary Cookies**) and colors to match your brand. If your channel supports a banner but you'd rather not show one, you can still use [Option 2](#option-2-add-a-custom-google-analytics-script-channels-without-a-cookie-banner).

## Option 1: Add Your Google Analytics ID (Channels With a Cookie Banner)

With this method, Sardius handles Google Analytics for you. To respect viewer privacy (GDPR), Google Analytics only starts tracking after a viewer accepts the cookie banner on your channel.

1. Log into [cp.sardius.media](https://cp.sardius.media).

2. Go to **Channels** and select the channel you want to track.

3. In the left menu, click **Channel Settings**, then select the **Social** tab.

   ![Sardius Control Panel left menu with Channel Settings highlighted under the Channel section](https://support.sardius.media/kb-media/516a30e288b8b9e9330c.png)

4. Paste your Measurement ID (for example `G-XXXXXXXXXX`) into the **Google Analytics GA4 ID** field.

   ![Channel Settings Social tab with the Google Analytics GA4 ID field highlighted at the top](https://support.sardius.media/kb-media/9d4e5bfcf7d587612cb1.png)

5. Make sure the **Custom Head Content** box further down the same tab does not also contain a Google Analytics script. If it does, remove it.

6. Scroll to the bottom of the page and click **Update Channel**.

**Note:** Make sure **Enable Banner** is switched on (see Step 1). Google Analytics only starts tracking after a viewer accepts the banner.

## Option 2: Add a Custom Google Analytics Script (Channels Without a Cookie Banner)

With this method, you manage the Google tag yourself. Tracking starts as soon as the page loads, with no cookie banner required. This is the right choice for custom layouts that don't include cookie banner settings.

1. Log into [cp.sardius.media](https://cp.sardius.media).

2. Go to **Channels** and select the channel you want to track.

3. In the left menu, click **Channel Settings**, then select the **Social** tab.

   ![Sardius Control Panel left menu with Channel Settings highlighted under the Channel section](https://support.sardius.media/kb-media/516a30e288b8b9e9330c.png)

4. **Clear the Google Analytics GA4 ID field** at the top of the tab. Leave it completely empty. If an ID is in this field, Sardius will hold tracking until cookies are accepted, which blocks your script too.

   ![Channel Settings Social tab with the Google Analytics GA4 ID field highlighted at the top](https://support.sardius.media/kb-media/9d4e5bfcf7d587612cb1.png)

5. Scroll down to **Custom Head Content** and paste your Google tag into the box. It should look like this, with your own Measurement ID in both places. The first line is long, so copy the whole block:

   ```html
   <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>
   ```

6. Click **Preview** to check that your channel still looks right. Invalid HTML in this box can break your channel.

7. Click **Update Channel** below the box.

   ![Channel Settings Social tab with the Custom Head Content box highlighted and an arrow pointing to the Update Channel button](https://support.sardius.media/kb-media/73c5e7166385358fd0c7.png)

**Note:** You are responsible for your channel's privacy and cookie consent requirements when using this method. If you serve viewers in regions covered by GDPR, check with your legal or compliance team first.

## Verify Tracking Is Working

1. Open your channel in a new browser window. If you used Option 1, accept the cookie banner.
2. In Google Analytics, go to **Reports > Realtime**.
3. Within a minute or two, you should see at least one active user. That's you.

**Tip:** Changes can take some time to appear while your channel's cache clears. If nothing shows up right away, wait a little and try again in a private or incognito window.

## Troubleshooting

| What you see                                                               | Likely cause                                                                                                        | What to do                                                                                      |
| -------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| No data in Google Analytics, and your page source shows `ga-disable-G-...` | An ID is in the Google Analytics GA4 ID field, but no viewer has accepted a cookie banner (or the channel has none) | Use Option 2: clear the Google Analytics GA4 ID field and add the script to Custom Head Content |
| Visits look doubled                                                        | Both methods are active at the same time                                                                            | Keep only one: either the ID field or the custom script                                         |
| Still no data after clicking Update Channel                                | Channel cache hasn't cleared yet                                                                                    | Wait, then check again in a private window                                                      |
| Data still missing after all of the above                                  | Something else is blocking the tag                                                                                  | Contact Sardius Support with your channel name and Measurement ID                               |
