Skip to main content

Add the script tag

Paste the following snippet before the closing </head> tag on every page you want to track:
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:

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:

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.
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).