This article is about how to integrate umami website analytics to your website for free. The database use postgres with 500M storage limit provided by supabase.
The umami service is hosted with vercel. Thanks to the excellent service capabilities of cloud vendors, you can integrate umami in less than 10 minutes. You can see the umami dashboard by clicking the Dashboard.
The database use postgres with 500M storage limit provided by supabase. You can create a supabase account, click new project
, and enter the database passowrd to create an ProgresSQL database service.
It will take a few minutes to create the database service, and you can get the DATABASE_URL
after it's done.
The umami service is hosted with vercel, Once you have created the database instance, you can deploy the umami service with click deploy button in the Running on Vercel document.
-
Fork the https://github.com/mikecao/umami project to your GitHub account.
-
Create an account on Vercel.
-
From the dashboard page click Import Project then specify the URL to your fork of the project on GitHub.
-
Add the required environment variables to your Vercel project. These values are defined in the Configure umami step from Install.
- DATABASE_URL: Connection string for your database. This is the only required variable.
- TRACKER_SCRIPT_NAME: Allows you to assign a custom name to the tracker script different from the default
umami
. This is to help you avoid some ad-blockers. I usedhugo-ladder
on this project.
-
Enter
yarn build && yarn update-db
to theBUILD COMMAND
, which will migrate the tables of umami to database automatically. -
Deploy and visit your application at .vercel.app.
-
Follow the Getting started guide starting from the Login step and be sure to change the default password.
Of course, if you want to import tables yourself, you can also get the tables from here https://github.com/umami-software/umami/blob/master/sql/schema.postgresql.sql.
After deploying umami in vercel you will get a <deploy-id>.vercel.app
address which login with the default account: admin and password: umami.
You can change the default password and Add webiste
, enter the Name
and Domain
, and click enable share URL
so that anyone can access the dashboard.
Then you can get data-website-id
and src
values by click Get tracking code
,enter the value to the hugo-ladder
configuration params.analytics.umami.website_id
, params.analytics.umami.url
.
Link to original article: https://guangzhengli.com/en/blog/en/how-to-integrate-umami-for-free-to-blog-site/