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

# Installation

> Add the GhostlyX tracking script to your site in under a minute.

## Add the script tag

Paste the following snippet before the closing `</head>` tag on every page you want to track:

```html theme={"dark"}
<script defer data-domain="yourdomain.com" src="https://ghostlyx.com/js/script.js"></script>
```

Replace `yourdomain.com` with the domain you configured when you created your site in GhostlyX. The value must match exactly. No protocol, no trailing slash.

## Platform guides

The snippet works on any site that serves HTML. Common setups:

| Platform    | Where to add the snippet                                                |
| ----------- | ----------------------------------------------------------------------- |
| Plain HTML  | Before `</head>` in your HTML file                                      |
| WordPress   | Appearance > Theme Editor > `header.php`, or use a header/footer plugin |
| Webflow     | Project Settings > Custom Code > Head code                              |
| Shopify     | Online Store > Themes > Edit code > `theme.liquid`                      |
| Next.js     | `pages/_document.js` or `app/layout.tsx` `<head>` section               |
| Squarespace | Settings > Advanced > Code Injection > Header                           |

## Single-page applications

For React, Vue, Angular, and other client-side routing frameworks, add the `data-spa="auto"` attribute so GhostlyX tracks route changes automatically:

```html theme={"dark"}
<script defer data-domain="yourdomain.com" src="https://ghostlyx.com/js/script.js" data-spa="auto"></script>
```

## Privacy

No cookies are set. No personal data is collected. The script does not use localStorage or fingerprinting of any kind. You do not need a cookie consent banner for the GhostlyX script.

## Verify installation

1. Open your site in a browser.
2. Open the GhostlyX dashboard and go to the **Real-time** tab.
3. Within 60 seconds you should see your visit counted as an active visitor.

<Note>
  If you do not see data after 60 seconds, check that the `data-domain` value matches the domain in your site settings exactly, and that the script tag is present in the rendered HTML (not just the source template).
</Note>
