umami
Product
DocsDevelopersPricing
16.8kLog inSign up
General
About
FAQ
Useful links
Getting started
Getting started
Install
Login
Add a website
Collect data
Basics
Add a user
Enable share URL
Track events
Teams
Updates
Languages
Advanced
Tracker configuration
Tracker functions
Environment variables
Reference
API
Authentication
Users
Teams
Websites
Website stats
Sending stats
Event Data
API Client
Cloud
Overview
API key
Import data
Guides
Migrating v1 to v2
Hosting
Running on DigitalOcean
Running on Vercel
Running on Neon Postgres
Running on Netlify
Running on Heroku
Running on Railway
Running on Supabase
Running on PlanetScale
Running on Qovery
Running on CapRover
Running on Koyeb
Running on Forge
Running on Fly.io
umami
Product
FeaturesPricing
Resources
DocsGuidesAPI ReferenceRelease Notes
Community
Get InvolvedGitHubDiscordTwitter
Company
AboutContactPrivacyTerms
© 2023 Umami Software, Inc.

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:

<script
  async
  defer
  src="http://mywebsite.com/umami.js"
  data-website-id="94db1cb1-74f4-4a40-ad6c-962362670409"
  data-host-url="http://stats.mywebsite.com"
></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:

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

data-do-not-track

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

Usage:

<script
  async
  defer
  src="http://mywebsite.com/umami.js"
  data-website-id="94db1cb1-74f4-4a40-ad6c-962362670409"
  data-do-not-track="true"
></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:

<script
  async
  defer
  src="http://mywebsite.com/umami.js"
  data-website-id="94db1cb1-74f4-4a40-ad6c-962362670409"
  data-cache="true"
></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:

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

Google Tag Manager

Google Tag Manager will strip the attributes from the tracker, so you can bypass this by using the format below.

Usage:

<script>
  (function () {
    var el = document.createElement('script');
    el.setAttribute('src', 'http://mywebsite.com/umami.js');
    el.setAttribute('data-website-id', '94db1cb1-74f4-4a40-ad6c-962362670409');
    document.body.appendChild(el);
  })();
</script>