Tracker configuration

The Umami tracker provides several properties that allow you to configure its behavior.

data-host-url

By default, Umami will send data to wherever the script is located. You can override this to send data to another location.

Usage:

  1. <script async defer
  2. src="http://mywebsite/umami.js"
  3. data-website-id="94db1cb1-74f4-4a40-ad6c-962362670409"
  4. data-host-url="http://stats.mywebsite.com"
  5. ></script>

data-auto-track

By default, Umami tracks all pageviews and events for you automatically. You can disable this behavior and track events yourself using the tracker functions.

Usage:

  1. <script async defer
  2. src="http://mywebsite/umami.js"
  3. data-website-id="94db1cb1-74f4-4a40-ad6c-962362670409"
  4. data-auto-track="false"
  5. ></script>

data-do-not-track

You can configure Umami to respect the visitor’s Do Not Track setting.

Usage:

  1. <script async defer
  2. src="http://mywebsite/umami.js"
  3. data-website-id="94db1cb1-74f4-4a40-ad6c-962362670409"
  4. data-do-not-track="true"
  5. ></script>

data-cache

If you get a lot of pageviews from the same user, for example in a forum website, you can cache some data to improve the performance of the tracking script.

Note: This will use session storage so you may need to inform your users.

Usage:

  1. <script async defer
  2. src="http://mywebsite/umami.js"
  3. data-website-id="94db1cb1-74f4-4a40-ad6c-962362670409"
  4. data-cache="true"
  5. ></script>

data-domains

If you want the tracker to only run on specific domains, you can add them to your tracker script. This is a comma delimited list of domain names. Helps if you are working in a staging/development environment.

Usage:

  1. <script async defer
  2. src="http://mywebsite/umami.js"
  3. data-website-id="94db1cb1-74f4-4a40-ad6c-962362670409"
  4. data-domains="mywebsite.com,mywebsite2.com"
  5. ></script>