Umami: a simple, easy-to-use, self-deployed website statistics program

888u

Last update at :2024-05-07,Edit by888u

Foreword:

After we build a website, even for a fishing blog like me, it is essential to install website statistics tools on the website. It can intuitively understand the website's access status, and is also beneficial to our SEO optimization analysis. Commonly used There are many third-party statistical platforms, such as 51LA, CNZZ, Google Analytics, Baidu Statistics, etc. Of course, if you are a website in mainland China and mainly submit it to Baidu for inclusion, I personally recommend using Baidu Statistics (I use Baidu Statistics). If you If you have the money to use the paid version, I won’t say anything. Of course, if webmasters only need to check PV, UV, source, landing page, equipment status and other information, what is recommended here is a self-deployed website statistics tool: Umami.

Introduction:

Umami is a simple, easy-to-use, self-hosted web analytics solution. The goal is to provide everyone with a friendlier, privacy-focused alternative to Google Analytics. Umami only collects the metrics that everyone cares about, and everything fits into a single page.

Advantages

  • Simple analysis: Umami only measures the important metrics you care about: pageviews, devices used, and where visitors are coming from, all displayed on a single page.
  • Multisite: Umami is capable of tracking an unlimited number of websites with a single installation, and you can even track subdomains and individual URLs.
  • Lightweight: The tracking script is small (less than 6kb) and supports older browsers such as IE.
  • Multiple accounts, privacy-focused, open source.

Installation and Deployment

Requirements:

  • Have a Node.js 10.13 or higher server
  • Database (MySQL or Postgresql)

Get the source code and install the package:

git clone https://github.com/mikecao/umami.git
cd umami
npm install

Create database table:
MySQL:

mysql -u username -p databasename < sql/schema.mysql.sql

Postgresql:

psql -h hostname -U username -d databasename -f sql/schema.postgresql.sql

Configuring Umami
Create the file .env with the following content:

DATABASE_URL=(connection url)
HASH_SALT=(any random string)

URL connection format:

postgresql://username:mypassword@localhost:5432/mydb
mysql://username:mypassword@localhost:3306/mydb

Generate database client:

MySQL:
npm run build-mysql-client
Postgresql:
npm run build-postgresql-client

Then run:

npm run build

Start the program:

npm start

Access address: http://your server ip:3000

Other

  • Project address: GitHub
  • Details: https://umami.is/docs/login
  • Relatively speaking, Umami's functions are only sufficient. Whether to use it depends on your own situation.
  • For domain name access, just reverse the port directly.

Recommended site searches: free domain name registration, US space, registration-free server in mainland China, Hengtian host, me domain name registration, foreign server rental price, expired domain name query, 6 yuan per year cloud server, industry and informatization Ministry website registration system, Dongguan server rental,

Umami: a simple, easy-to-use, self-deployed website statistics program

All copyrights belong to 888u unless special state
取消
微信二维码
微信二维码
支付宝二维码