---
title: How to enable cross-domain tracking in Google Analytics 4 (GA4)?
description: Learn how to enable cross-domain tracking in Google Analytics 4 using URL parameters, ensuring consistent sessions and accurate data across multiple domains.
---

[Skip to content](https://help.spalopia.app/en/centro-de-ayuda/how-to-enable-cross-domain-tracking-in-google-analytics-4-ga4#main-content)

- [English](https://help.spalopia.app/en/centro-de-ayuda/how-to-enable-cross-domain-tracking-in-google-analytics-4-ga4)
- [Español](https://help.spalopia.app/es/centro-de-ayuda/cómo-activar-el-cross-domain-tracking-en-google-analytics-4-ga4)

English

Show submenu for translations

[![spl-siana-imagotype-color.svg\]](https://help.spalopia.app/hubfs/spl-siana-imagotype-color.svg)](https://sianabyspalopia.com/)

Open main navigation

Close main navigation

- - [English](https://help.spalopia.app/en/centro-de-ayuda/how-to-enable-cross-domain-tracking-in-google-analytics-4-ga4)
    - [Español](https://help.spalopia.app/es/centro-de-ayuda/cómo-activar-el-cross-domain-tracking-en-google-analytics-4-ga4)

  English
  
  Show submenu for translations

 Hello. How can we help you?

- There are no suggestions because the search field is empty.

1. [Support center](https://help.spalopia.app/en/centro-de-ayuda?hsLang=en)
2. [Online Booking/Sales Engine](https://help.spalopia.app/en/centro-de-ayuda/online-booking-sales-engine?hsLang=en)
3. [Settings](https://help.spalopia.app/en/centro-de-ayuda/online-booking-sales-engine?hsLang=en#settings)

# How to enable cross-domain tracking in Google Analytics 4 (GA4)?

This manual explains how to enable **cross-domain tracking** in Google Analytics 4 (GA4) using query parameters in the URL.  
👉[What data can be collected from GA4?](https://help.spalopia.app/es/centro-de-ayuda/qu%C3%A9-registros-se-pueden-obtener-desde-facebookpixel-y-ga4?hsLang=en)

Cross-domain tracking allows you to track users as they move across different domains while maintaining a single Analytics session and avoiding duplicated data.

##### How do you activate cross-domain tracking?

**Add the `domains` parameter to the URL**  
To enable cross-domain tracking, add the `domains` parameter to the URL, including the list of domains separated by commas.

#### 💬 **For example**:

| #### ***https://ejemplo.com/path?domains=dominio1.com,dominio2.com,subdominio.dominio3.com*** |
| --- |

#### 💬 **Practical example**

#### *Original URL:*

| #### ***https://160-f1401014.spalopia.app/es/engine/163/channel/web/utb-spa-booking-simple?rfh\_currency=EUR&clear\_filters=1*** |
| --- |

#### *URL with cross-domain tracking enabled:*

| #### ***https://160-f1401014.spalopia.app/es/engine/163/channel/web/utb-spa-booking-simple?rfh\_currency=EUR&clear\_filters=1&domains=spalopia.com,booking.spalopia.app*** |
| --- |

#### **Correct domain format** The domains included in the `domains` parameter must meet the following conditions:

- Separated by commas and without spaces (`domain1.com,domain2.com`)
- No protocol included (`http://` or `https://`)
- Subdomains can be included (`sub.example.com`)

#### 💬 **For example:**

- `?domains=example.com`
- `?domains=example.com,booking.example.com`
- `?domains=spalopia.com,booking.spalopia.app,www.spalopia.com`

**System behaviour**

- **Configuration priority**  
  The system applies the cross-domain tracking configuration following this priority order:  
    1. `domains` query parameter (highest priority)
    2. `google-ga4-domains` session value
    3. Persistent configuration

- **Session persistence**  
  When the `domains` parameter is received via URL:  
    - It is automatically stored in the session.
    - It is reused on subsequent pages for the duration of the session.
    - It can be overwritten by sending a new value via the query parameter.

#### 💬 **For example**:

| #### ***\<iframe src="https://dominio-externo.com/path?domains=dominio-principal.com,dominio-externo.com"\>\</iframe\>*** |
| --- |

#### **Verifying that it works:**

- **From the browser**  
    1. Open the developer tools (F12).
    2. Go to the **Network** tab.
    3. Filter by `gtag` or `collect`.
    4. Check that the request contains the `_gl` parameter  
       (this indicates that the GA4 linker is active).
- **From the JavaScript console**
  
  Verify that events have been generated with the domain configuration by running:
  
  | console.log(window.dataLayer); |
  | --- |

**💡 Important notes**

- The `domains` parameter must be present on both involved domains.
- Domains must be correctly written (no spaces, no protocol).
- All domains must use the same GA4 tracking code.
- The value stored in the session is reused automatically.
- You can override the configuration by adding a new value via the query parameter.

 

 

📩 If you have any questions during the process, please write to soporte@spalopia.com

 

- [Configuration and settings](https://help.spalopia.app/en/centro-de-ayuda/configuration-and-settings?hsLang=en#main-content)

    - [Basic Configuration](https://help.spalopia.app/en/centro-de-ayuda/configuration-and-settings?hsLang=en#basic-configuration)
    - [Advanced Configuration](https://help.spalopia.app/en/centro-de-ayuda/configuration-and-settings?hsLang=en#advanced-configuration)
    - [Payment Methods](https://help.spalopia.app/en/centro-de-ayuda/configuration-and-settings?hsLang=en#payment-methods)
- [Agenda](https://help.spalopia.app/en/centro-de-ayuda/agenda?hsLang=en#main-content)

    - [Resources](https://help.spalopia.app/en/centro-de-ayuda/agenda?hsLang=en#resources)
    - [Reservations](https://help.spalopia.app/en/centro-de-ayuda/agenda?hsLang=en#reservations)
    - [Employees](https://help.spalopia.app/en/centro-de-ayuda/agenda?hsLang=en#employees)
    - [Treatments](https://help.spalopia.app/en/centro-de-ayuda/agenda?hsLang=en#treatments)
    - [Packs](https://help.spalopia.app/en/centro-de-ayuda/agenda?hsLang=en#packs)
    - [Settings](https://help.spalopia.app/en/centro-de-ayuda/agenda?hsLang=en#settings)
- [Online Booking/Sales Engine](https://help.spalopia.app/en/centro-de-ayuda/online-booking-sales-engine?hsLang=en#main-content)

    - [Reservations](https://help.spalopia.app/en/centro-de-ayuda/online-booking-sales-engine?hsLang=en#reservations)
    - [Tips](https://help.spalopia.app/en/centro-de-ayuda/online-booking-sales-engine?hsLang=en#tips)
    - [Settings](https://help.spalopia.app/en/centro-de-ayuda/online-booking-sales-engine?hsLang=en#settings)
    - [Refunds](https://help.spalopia.app/en/centro-de-ayuda/online-booking-sales-engine?hsLang=en#refunds)
- [CRM](https://help.spalopia.app/en/centro-de-ayuda/crm?hsLang=en#main-content)

    - [Groups and Channels](https://help.spalopia.app/en/centro-de-ayuda/crm?hsLang=en#groups-and-channels)
    - [Online pre check-in](https://help.spalopia.app/en/centro-de-ayuda/crm?hsLang=en#online-pre-check-in)
- [Reports](https://help.spalopia.app/en/centro-de-ayuda/reports?hsLang=en#main-content)

    - [Reports](https://help.spalopia.app/en/centro-de-ayuda/reports?hsLang=en#reports)
- [Point of Sale](https://help.spalopia.app/en/centro-de-ayuda/point-of-sale?hsLang=en#main-content)

    - [Point of Sale Operation](https://help.spalopia.app/en/centro-de-ayuda/point-of-sale?hsLang=en#point-of-sale-operation)
    - [Products](https://help.spalopia.app/en/centro-de-ayuda/point-of-sale?hsLang=en#products)
    - [Configuration | Point of Sale](https://help.spalopia.app/en/centro-de-ayuda/point-of-sale?hsLang=en#configuration-point-of-sale)
- [Integrations](https://help.spalopia.app/en/centro-de-ayuda/integrations?hsLang=en)
- [Statistics](https://help.spalopia.app/en/centro-de-ayuda/statistics?hsLang=en)

[![Spalopia](https://help.spalopia.app/hs-fs/hubfs/spl-imagotype-color-1.png?width=150&height=72&name=spl-imagotype-color-1.png "Spalopia")](https://sianabyspalopia.com/en/)

Copyright © 2026, Spalopia S.L.