In this blog post, I'll walk you through the process of setting up Umami, a powerful and privacy-focused self-hosted web analytics platform. I'll also highlight the benefits and key features that make Umami a great alternative to traditional analytics tools.
Introduction
In today’s digital landscape, data privacy is more important than ever. Many businesses and individuals are looking for ways to track website performance without compromising user privacy. Umami is an open-source, self-hosted web analytics tool that offers a lightweight, customizable, and privacy-focused alternative to platforms like Google Analytics. By hosting Umami on your server, you maintain complete control over your data, ensuring that your users' privacy is protected.
Benefits of Using Umami
Privacy-Focused Analytics
One of the main advantages of Umami is its strong emphasis on privacy. Unlike many other analytics platforms, Umami is completely cookie-free, meaning it doesn’t track users across different sites or store personal data. It’s fully compliant with privacy regulations like GDPR, CCPA, and PECR, which helps you avoid legal complications and build trust with your users.
Full Control and Customizability
With Umami, you have complete control over your analytics data. Since it’s self-hosted, all data is stored on your server, and you can customize the platform to fit your specific needs. Whether you want to tweak the user interface, add new features, or integrate it with other tools, Umami’s open-source nature gives you the flexibility to do so.
Lightweight and Easy to Use
Umami is designed to be lightweight and easy to set up. It provides essential analytics features without the bloat of more complex platforms, making it perfect for users who want straightforward insights without unnecessary complications. Despite its simplicity, Umami offers powerful features like real-time analytics, custom event tracking, and multi-site support.
Features of Umami
Real-Time Analytics
Umami offers real-time data on website visits, page views, and user actions. This allows you to see how visitors are interacting with your site as it happens, enabling you to make quick decisions and adjustments.
Custom Event Tracking
With Umami, you can track custom events such as button clicks, form submissions, or video plays. This feature allows you to monitor specific interactions that are important to your website’s goals, giving you deeper insights into user behavior.
Multi-Site Support
If you manage multiple websites, Umami’s multi-site support allows you to track them all from a single instance. This makes it easy to compare performance across different sites and manage your analytics in one central place.
Anonymous Session Tracking
The new anonymous session tracking feature allows you to view individual user sessions without compromising privacy. You can analyze how users navigate through your site, understand their journey, and optimize content and layouts based on real user interactions—all while ensuring that no personal data is collected.
API Access
Umami provides an API that allows you to pull analytics data into custom dashboards or applications. This feature is particularly useful if you want to integrate Umami’s data with other tools or build custom reporting solutions.
Setting Up Umami
Prerequisites
Before setting up Umami, you’ll need the following:
- A server or hosting platform to deploy Umami.
- A PostgreSQL or MySQL database.
- Basic knowledge of command line operations.
Step 1: Deploy Umami
To get started, you can use the Umami Template on Vercel available here. Vercel is a popular choice for hosting Umami because it’s easy to use and integrates well with the platform. However, you can also deploy Umami on other platforms like DigitalOcean, Heroku, or AWS.
Alternatively, you can fork or clone the Umami repository from GitHub and deploy it manually on your server using Docker or Node.js. The Umami documentation provides detailed instructions on how to set up the platform on different environments.
Step 2: Set Up the Database
Umami requires a PostgreSQL or MySQL database to store your analytics data. If you’re using Vercel, you can connect to Vercel’s own database solution, but you may want to consider other options like Neon.tech, which offers free Postgres hosting.
Once your database is set up, you’ll need to set the database connection url to your DATABASE_URL
environment variable.
Step 3: Configure Umami
After deploying Umami and setting up your database, log in with the default credentials (admin
/umami
). It’s important to change these credentials immediately to secure your instance. From the admin panel, you can configure your tracking scripts, add websites, and customize settings to suit your needs.
Step 4: Add the Tracking Script
To start collecting data, you’ll need to add the Umami tracking script to your website. Insert the script into the <head>
section of your website’s HTML. This script points to a JavaScript file hosted on your Umami instance, which collects data and sends it to your database.
Step 5: Explore the Dashboard
Once your website is being tracked, you can explore the Umami dashboard to view real-time analytics, set up custom events, and manage multiple websites. The dashboard provides a clean and intuitive interface where you can monitor all your analytics in one place.
Conclusion
Setting up Umami is a straightforward process that offers significant benefits for those looking to maintain control over their data and prioritize user privacy. With features like real-time analytics, custom event tracking, and multi-site support, Umami is a powerful and flexible tool that can meet the needs of various types of websites. Whether you’re running a personal blog, a small business site, or multiple web properties, Umami provides the insights you need without compromising on privacy or complexity.