DEV Community

Cover image for How to set up free web analytics with Umami
Oz Ertas
Oz Ertas

Posted on • Originally published at ertas.dev

How to set up free web analytics with Umami

If you want to stay clear of Google but don't want to break the bank, Umami makes web analytics simple and free. It is a self-hosted web analytics solution that you can deploy to Heroku.

Umami is privacy-focused and only collects the metrics you care about. You can view the live demo to see it in action.

To get started, set up a free account with Heroku.

Umami provides great documentation on how to complete the manual installation. But there is also a Heroku Button that we can use that requires zero effort.

Go ahead and click the "Button" below, give your app a name and click Deploy app. Heroku will take care of the rest of the set up.

Deploy to Heroku

(Although Umami has their own Button in the documentation, at the time of writing, it is not usable for me. I went for the alternative made by Better-CF above.)

Once the build succeeds, click Open app in your Heroku dashboard to get to your Umami instance.

A default administrator account is already set up as admin with the password umami.

login page

After you log in and change your password, go to Settings, Websites and click on the Add website button.

add website page

Once you fill out the form and click Save, click on the Get tracking code button on the Websites page.

get tracking code button

Copy the code and insert it into the head section of your website. It looks like the one below:

<script async defer data-website-id="d8402665-41eb-4cda-b520-09dcc62972ce" src="https://your-umami-app.herokuapp.com/umami.js"></script>
Enter fullscreen mode Exit fullscreen mode

Go ahead and give your website a visit to see the data immediately appear in your Umami dashboard.

Congratulations! Your website now uses free and open source web analytics.

(You should note that the Postgres database that stores your data has a limit of 10000 rows for the free tier. Depending on your site traffic, you may need to consider upgrading to a paid tier on Heroku.)

Top comments (0)