Before you start
Create a site in UserTrail before installing the tracking script. Each site has its own tracking snippet and site id, so make sure you copy the snippet from the site that matches the domain you want to track.
You need access to one of the following:
- your website's HTML template
- your CMS header or footer scripts area
- Google Tag Manager or another tag manager
- your developer or deployment pipeline
Copy your tracking script
Open your site in the dashboard and copy the UserTrail tracking snippet from the installation modal.
Install the snippet on every page you want to analyse. For most websites, add it to the shared layout, theme, or tag manager container so it loads across the full site.
Recommended placement:
- before the closing
</head>tag, or - through a tag manager that fires on the pages you want to track
The tracker loads asynchronously, so it should not block the page from rendering.
Install directly in your site
If you control the website template, paste the snippet into the shared layout.
For example:
<head>
<!-- other scripts and metadata -->
<!-- UserTrail tracking snippet -->
</head>
After deploying, open your live site and confirm the script is present in the page source or browser developer tools.
Install with Google Tag Manager
To install with Google Tag Manager:
- Create a new Custom HTML tag.
- Paste the UserTrail snippet into the tag.
- Choose the trigger, usually All Pages or a consent-aware analytics trigger.
- Publish the container.
- Visit the website and confirm sessions start appearing in UserTrail.
If you use consent mode, make sure the tag only fires after analytics consent is granted.
Install on common platforms
For WordPress, add the snippet through your theme header, a header scripts plugin, or Google Tag Manager.
For Shopify, add the snippet through your theme code or customer events setup, depending on the pages you need to track and your privacy requirements.
For Webflow, add the snippet in the site's custom code settings or in the page-level custom code area.
For custom React, Next.js, Vue, or SPA websites, install the snippet in the shared app layout so it remains available during route changes.
Verify installation
Visit your website in a new browser tab and interact with a tracked page. Click, scroll, and move between pages if your site is a single-page app.
The dashboard should start showing:
- sessions
- tracked page paths
- heatmap activity
- device and browser information
- friction events when relevant
Data may not appear instantly because events are batched and processed before they are shown in the dashboard.
Watch your first session
After the first eligible visitor session is recorded, open Sessions for the site. You should see the new recording in the session list.
If session replay is enabled, open the recording and check that:
- the page loads correctly
- private fields are masked
- interactions are visible
- the path and device type look correct
Use this first recording as a setup check before relying on production reports.
Consent mode
If your website requires consent before analytics tracking, load tracker.js only after consent has been granted. UserTrail does not force-load the tracker before your consent flow.
In a consent-aware setup:
- Your consent banner loads first.
- The visitor grants analytics consent.
- Your site or tag manager loads UserTrail.
- UserTrail starts tracking from that point onward.
If the visitor denies analytics consent, do not load the UserTrail script.
Troubleshooting
If no data appears:
- Check that the snippet is installed on the live website, not only a staging preview.
- Confirm the site id in the snippet matches the site in UserTrail.
- Disable ad blockers or privacy extensions while testing.
- Confirm your consent settings allow the script to load.
- Check browser developer tools for blocked network requests.
- Make sure the page is not excluded by your own tracking rules.
- Wait a few minutes for batched events to process.
If sessions appear but replay looks incomplete:
- Confirm the tracker is installed on all pages in the journey.
- Check that important assets are publicly reachable.
- Review privacy masking rules to make sure the whole page was not masked.
- Test on desktop, tablet, and mobile if your site has different layouts.
Installation checklist
- Site created in UserTrail.
- Snippet installed on the right domain.
- Consent rules configured where required.
- Test visit recorded.
- Private fields masked.
- Sessions and heatmaps visible in the dashboard.