> For the complete documentation index, see [llms.txt](https://docs.uxwizz.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.uxwizz.com/installation/adding-the-tracking-code.md).

# Adding the tracking code

Complete [installation](/installation/installation.md) and open your HTTPS dashboard before adding the tracker to your website.

## 1.4 Tracking a domain

1. Use **Add domain** to add the website you want to track. If your account cannot add domains, ask an administrator to grant access in **Settings → Users & domains**.
2. Open **Include the tracking pixel** for that domain. Choose the [recording mode](/api/session-recording.md) and enable **A/B tests** only if you need them.
3. Copy the complete snippet from the dashboard. Add it once to the shared page template, before `</head>`, on the pages you intend to track.
4. Check your site's consent and [sensitive-element exclusions](/api/session-recording/ignore-specific-elements.md) before collecting real visits.
5. Visit the site, navigate through a few pages, then open **Visitors** for the same domain and date range. Allow time for the tracker to send its data and refresh the view.

The generated snippet contains the correct installation URL and domain-specific A/B file when enabled. Do not paste an example hostname into your production site.

A basic recording snippet has this shape:

```html
<script>
UST_CT = [];
UST = { s: Date.now(), addTag: function(tag) { UST_CT.push(tag); } };
UST.addEvent = UST.addTag;
</script>
<script src="https://analytics.example.com/server/ust.min.js" async></script>
```

Use `ust-rr.min.js` for full recording, as provided by the dashboard. Do not include both tracker files or install the same snippet through both your page template and a tag manager.

For A/B tests, use the complete generated snippet, including its anti-flicker code and domain-specific script. Publish only tests you have reviewed; see [A/B testing](/guides/a-b-testing.md).

For single-page applications, also configure one route-change integration:

* [Next.js](/installation/adding-the-tracking-code/add-tracker-to-next.js-app.md)
* [React Router](/installation/adding-the-tracking-code/add-tracker-to-react-router-app.md)
* [Other SPA frameworks](/installation/adding-the-tracking-code/automatic-spa-pageview-tracking.md)

#### Different tracking settings for each domain?

The current **Tracking settings** apply across the installation. Recording mode and inclusion of A/B code can differ through the snippet used on each site.

### Advanced: keep a separate tracker configuration for one site

You can keep a generated tracker under a different filename, as described in earlier versions of this guide. This needs file access to the UXWizz server and maintenance after every update.

1. Save the desired configuration in **Tracking settings**. This regenerates the standard tracker files for every site that uses them, so plan the change before doing this on a live installation.
2. Copy the generated file for your recording mode, for example `server/ust.min.js` to `server/ust.min.site-b.js`. For full recording, copy `ust-rr.min.js` instead. Keep the copy in the same directory.
3. Restore the usual global settings for the other sites.
4. On the selected site, change only the tracker's `src` URL to the copied filename. Keep the initialization and any A/B-test code from its generated snippet.
5. Check the copied script loads, then verify a visit and the intended recording/heatmap settings on that site.

{% hint style="warning" %}
The dashboard regenerates the standard filenames only. Your copy will not receive later settings or tracker fixes automatically. After each UXWizz update, regenerate and replace it using the desired settings, then repeat the checks. Use a separate installation if you need independently managed settings without maintaining custom tracker copies.
{% endhint %}

This changes settings embedded in the browser tracker. Server-side controls, such as ignored-IP rules and retention, still apply across the installation.

## Common failures

* **No new visit:** check the domain and date filters, consent choice, opt-out, ignored IP settings, and browser blockers. Follow [No data is being recorded](/guides/troubleshooting/tracking/no-data-is-being-recorded.md).
* **Tracker request fails:** check its exact URL and status in the browser's **Network** panel. Missing files or blocked PHP requests need server access.
* **Duplicate pageviews:** remove duplicate snippets or route-change listeners.
* **Missing A/B file:** follow [The A/B test JS file is missing](/guides/troubleshooting/tracking/the-a-b-test-js-file-is-missing.md).
