UXWizz
WebsitePricingDemoTwitter (X)
  • Introduction
  • 🛠️ Installation
    • Requirements
      • Limitations
      • Server specs (CPU, RAM)
    • Installation guide
      • Uploading the script
      • Creating a MySQL database
      • Running the installer
    • Install on a new server
      • Ubuntu 20.04 (or higher)
      • DigitalOcean
    • Docker
      • Via Docker Compose
      • Standalone Docker image
    • Adding the tracking code
      • Automatic SPA pageview tracking
      • Add tracker to Next.js App
      • Add tracker to React Router App
    • Optimization tips
      • MySQL/MariaDB
      • Auto-delete old data (cron jobs)
      • Apache
    • Frequently Asked Questions
  • 🔧JavaScript API
    • Tags
    • Events
    • Hooks/callbacks
    • Other API functions
    • Session Recording
      • Ignore specific elements
  • 📖Guides and features
    • Goals (NEW!)
    • Ask AI (NEW!)
    • Basic usage
    • A/B testing
    • Usage tips
    • Dashboard user access level
    • Resetting the admin password
    • Database querying
    • Technical details
      • IP Geolocation
    • Troubleshooting
      • Agency
        • MultiDB
      • Dashboard
        • Refreshing dashboard sub-page leads to 404 error
        • Website iframe not loading (x-frame-options)
        • License says "invalid"
        • Updating Fails
      • Tracking
        • No data is being recorded
        • Can't include tracker via Google Tag Manager
        • The A/B test JS file is missing
      • WordPress
        • Cloudways 403 Forbidden screen on WordPress
        • NGINX 403 Forbidden screen on WordPress
    • Extending the dashboard
    • Support
    • Migrating to a new server
  • 🎓Useful Examples
    • Feedback form (polls)
    • Tracking 404 Pages
    • Tracking UTM parameters
    • Tracking Google Ads GCLID
    • Storing user device types
    • Track video playback
  • 📜About
    • Changelog
    • Personal Data Information
    • Privacy Policy (uxwizz.com)
    • Licenses and pricing
    • [Deprecated] License Subscriptions
Powered by GitBook
On this page

Was this helpful?

  1. 🛠️ Installation

Adding the tracking code

PreviousStandalone Docker imageNextAutomatic SPA pageview tracking

Last updated 10 months ago

Was this helpful?

  1. Add the tracking code to your site

1.4 Tracking a domain

Note: You should include the snippets provided in the UXWizz dashboard, which are unique for each domain.

You can track unlimited domains on a single UXWizz installation. To track a new domain you have to do two things:

  1. Add the domain name by giving domain access to your own user using the one of the Add domain buttons (from main overview, domain selector or settings→users).

  2. Include the tracking script on that domain. On each page of the tracked domain you need to include this JavaScript file:

The actual snippets/links are provided in your dashboard!

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

Add it just before the end of the head tag, like so:

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

Note that if you want to use the AB testing feature the tracking code is bigger AND different for each domain (get this code from the interface, for each domain on the Domains page):

<script>
UST_CT = [];UST = { s: Date.now(), addTag: function(tag) { UST_CT.push(tag) } };UST.addEvent = UST.addTag;
// Prevent AB test flashing
(function() {var ust_s = document.createElement('STYLE');ust_s.id = 'ust_body_style';
ust_s.appendChild(document.createTextNode('body {visibility: hidden}'));document.head.appendChild(ust_s);})();
setTimeout(function(){ var el = document.getElementById('ust_body_style'); el && el.remove()}, 800);
</script>
<script src="https://your.uxwizz.com/server/ab/trackeddomain.com.ab.js" defer></script>
<script src="https://your.uxwizz.com/server/ust.min.js" async></script>

On what pages to include the script?

It is recommended to include the script on all pages, but you might not want to include the tracking script on sensitive pages such as the login page.

Different tracking settings for each domain?

If you want different tracking settings for each domain tracked you can change the settings inside the generated ust.min.js tracker file, saving it with another name (eg: ust.min.domain.js) and include this copy on the other domain instead of the original ust.min.js.

Note: that when you do this, whenever you change settings in the UI, only the original ust.min.js will be updated/regenerated.

Domain-specific settings is a planned future.

If everything worked as expected you should immediately see visitors data in your dashboard after a refresh, you can test if the script is working by visiting yourself the site you have installed the tracker on.

Upload the script
Create a new MySQL database for UXWizz
Run the auto installer