> ## Documentation Index
> Fetch the complete documentation index at: https://docs.halth.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Analytics

> Set up conversion tracking for your booking page.

## Google Tag Manager

### Overview

The HaltH booking page supports Google Tag Manager (GTM) per organisation. When a GTM Container ID is configured, GTM loads dynamically on your booking page and fires events automatically.

### Setup

#### In Google Tag Manager

1. In your GTM account, create or select a container for your booking page domain.
2. Copy the **Container ID** (format: `GTM-XXXXXXX`).
3. Create custom event triggers for `halth_booking_start` and `purchase`.
4. Save and publish these changes.

Click [here](https://support.google.com/tagmanager/answer/15756616?sjid=16630981582792209044-NC) to learn more about setting up Google Tag Manager.

#### In HaltH

1. In the HaltH platform, click [here](https://business.halth.com/organisation/settings?tab=bookings) or navigate to Settings > Bookings.
2. Open the Analytics settings.
3. Paste in your Google Tag Manager Container ID (format: `GTM-XXXXXXX`) and save.

Your GTM container will now load on every booking page visit and publish events for bookings.

### Events

The booking page pushes the following events. Use these as GTM triggers.

##### `halth_booking_start`

Fired once when the booking form is initialised (page load).

**Use for:** Tracking ad-driven traffic entering the booking funnel.

##### `purchase`

Fired once when a booking is successfully confirmed.

UTM and click-ID properties are included automatically when the visitor arrived at the booking page with those parameters in the URL.

**Use for:** Google Ads conversion tracking, GA4 purchase events.

## Troubleshooting

### Cross-domain tracking breaks inside an iFrame

**Symptom:** Cross-domain tracking isn't working and the `_gl` linker parameter isn't being added to your HaltH links, so sessions don't carry across from your site to the booking page.

**Cause:** Some website builders render an entire page inside an iFrame. This is common on Wix when a page is built with a custom HTML component instead of the standard editor — Wix wraps the whole page content in an iFrame. Because the Google tag loads outside that iFrame, it can't apply the cross-domain linker to the links inside it, so the `_gl` parameter never gets appended to your HaltH links.

**Fix:** Add the Google tag **inside** the iFrame — i.e. inside the same HTML component that holds your page content — and configure the cross-domain linker with your domains. For example, place the following in the page's code block:

```html theme={null}
<!-- Google tag (gtag.js) inside the HTML component -->
<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', {
    'linker': {
      'domains': ['halth.com', 'app.halth.com']
    }
  });
</script>
```

Replace `G-XXXXXXXXXX` with your own Google Analytics measurement ID and update the `domains` list to match the domains you're linking between.

<Note>
  If a builder loads an entire page inside an iFrame, the tracking script must be added **inside** the iFrame — a tag placed on the outer page won't be able to add the linker parameter to the links within it. Keep this in mind whenever you build new pages.
</Note>
