Self-Hosted Analytics: Umami, Supabase, PlanetScale, Vercel Unleashed

July 14, 2023 (1y ago)

Umami Supabase PlanetScale Vercel Unleashed

Are you sick of using website analytics tools that put your users' privacy at risk? Do you want to build your own analytics tool that protects the privacy of your users and gives you full control over your data? If so, You came to the right place.

💡

In this post, I'll talk about how to use open-source tools like Umami, Supabase, Planetscale and Vercel to build your own website analytics platform with a focus on privacy. With this, you can learn how to make a analytics that protects user privacy, gives you full control over your data, and is open to everyone.

Why should you choose Umami?

Umami Analytics is a revolutionary data analysis platform. Umami is a modern self-hosted analytics solution that prioritises user privacy, simplicity, and power.

Umami prioritises user privacy. Umami is a privacy-focused analytics platform. Transparency and control over acquired data protects user privacy. Umami ensures that your analytics practises follow ethical data management norms, boosting trust and user experience.

Umami's elegant interface is another draw. It's aimed for non-technical users. Umami's simple setup and sleek UI make analytics data easy to understand. Track critical metrics, user behaviour, and website or app performance easily.

Umami's extensive features boost its attractiveness. It tracks real-time events, custom events, goals, and more. Explore detailed reports, segment data, and find patterns and trends to make data-driven decisions. Umami lets you analyse data and optimise methods.

Umami's self-hosting allows you full control over your analytics infrastructure. You can host it on your own server or cloud to maintain data ownership. Businesses with strict data security and regulatory requirements need this level of control.

Requirements

  1. A Github account
  2. A Vercel account
  3. A Supabase account or A PlanetScale account

Setting Up Umami with Supabase and Vercel

As an open-source alternative to traditional databases, Supabase offers a powerful and flexible platform that empowers you to take control of your data.

Step 1: Setting up a Supabase database

  1. Go to Supabase. then click on Continue with GitHub.
Signing up on Supabase
  1. create an organization with any suitable name
creating an organization on supabase
  1. Now go to Project Settings, And then go to Database from left sidebar.
getting connection string on supabase
  1. Copy your connection string from nodejs tab. which will be like this:
postgres://postgres:[YOUR-PASSWORD]@db.abcdefghijklmnopqr.supabase.co:6543/postgres
  1. Now add this to the end of your connection string.
?pgbouncer=true
  1. your connection string will be like:
postgres://postgres:[YOUR-PASSWORD]@db.abcdefghijklmnopqr.supabase.co:6543/postgres?pgbouncer=true

Step 2: Deploying Umami with Supabase to Vercel

  1. Login to your Vercel account
  2. Click on Add new project
  3. Choose Your Umami repository
  4. Give it a suitable name you wish
adding new project to vercel
  1. Click on Environment Variables and Add your connection string like this:
DATABASE_URL=postgres://postgres:[YOUR-PASSWORD]@db.abcdefghijklmnopqr.supabase.co:6543/postgres?pgbouncer=true
  1. Click on Deploy
deploying umami to vercel

Now let's dive into PlanetScale which will be an alternative method.

Setting Up Umami with PlanetScale and Vercel

PlanetScale provides a robust database system with seamless data flow, high availability, and excellent performance. Businesses looking for a reliable and scalable data storage solution will love its novel features and advanced functions. Let's dive in!

  1. Sign up on PlanetScale.
  2. Create an account
  3. Click on create
creating database with planetscale
  1. Database name should be umami-db
  2. Choose hobby plan if you want to use the free plan
creating database with planetscale quickly
  1. Click on create database
creating a database with planetscale
  1. Choose Prisma here
  2. Get the connection string.
getting database url from planetscale
  1. Copy & Add this to your .env
getting database url from planetscale
  1. Run this:
yarn run build-db && yarn run update-db
  1. deploy to Vercel now.

Setting up your website on Umami

  1. Go to your deployed Umami site
  2. Login with default username admin and password umami
  3. Go Settings > Websites > Add website
getting database url from planetscale
  1. Go to edit> Tracking Code> Copy this script
  2. Add this script to your document.js or app/layout.tsx
  3. Done

Conclusion

Harnessing the combined power of Umami, Supabase, PlanetScale and Vercel, you can forge a sophisticated analytics platform that embraces user privacy and grants you unparalleled control over your data. By leveraging these open-source tools, you can create a data-driven ecosystem that is not only robust but also accessible to all, regardless of financial resources or technical proficiency. Don't hesitate to embark on this transformative journey and unlock the true potential of your data.

FAQs

  1. Is Umami Analytics open-source?
  • Yes, Umami Analytics is an open-source project, which means the source code is freely available for users to view, modify, and contribute to its development.
  1. Can I self-host Umami Analytics?
  • Yes, Umami Analytics is designed to be self-hosted, allowing you to have complete control over your data and ensuring data privacy.
  1. What are the key features of Umami Analytics?
  • Umami Analytics offers features such as real-time tracking, customizable dashboards, goal tracking, event tracking, geographic data, and more to provide valuable insights about your website visitors.
  1. How does Umami handle user privacy?
  • Umami respects user privacy by providing transparency and control over data collection. It allows you to anonymize IP addresses, honor Do Not Track requests, and provides options for cookie consent management.
  1. Is Umami suitable for small businesses or personal websites?
  • Yes, Umami is well-suited for small businesses, personal websites, and projects of any size that require a privacy-focused analytics solution. I'm also using.
  1. Does Umami offer real-time analytics?
  • Yes, Umami does offer real-time analytics. It provides live updates and real-time tracking of website visitors, allowing you to monitor and analyze user activity as it happens.
  1. How can I contribute to the Umami Analytics project?
  • You can contribute to Umami's development by submitting code improvements, bug fixes, or new features via pull requests on the official Umami GitHub repository