Swetrix vs Tianji

A side-by-side comparison of two self-hosted web analytics options — licensing, setup difficulty, resource needs, and what each one replaces.

Not the right match-up?
FeatureSwetrixTianji
Deploy effortUnder-an-hour setupUnder-an-hour setup
Health score83 · Excellent87 · Excellent
CategoryWeb AnalyticsWeb Analytics
LicenseAGPL-3.0Apache-2.0
LanguageTypeScriptTypeScript
Setup difficultyMediumMedium
Min. RAM512 MB512 MB
Deploymentdockerdocker
GitHub stars★ 1,202★ 3,100
First released20212023
ReplacesGoogle AnalyticsGoogle Analytics

What are Swetrix and Tianji?

Swetrix

Swetrix is an open-source, privacy-focused web analytics platform that is fully cookieless and GDPR compliant. It tracks page views, user flows, and custom events without identifying visitors.

  • Cookieless tracking
  • User flow analysis
  • Custom events
  • Performance metrics

Read the full Swetrix guide →

Tianji

Tianji is an all-in-one insight hub that combines website analytics, uptime monitoring, and server status into a single application. It offers a unified dashboard for observing your sites and infrastructure.

  • Website analytics
  • Uptime monitoring
  • Server status reporting
  • Unified insight dashboard

Read the full Tianji guide →

Swetrix vs Tianji: key differences

Both projects are written in TypeScript. Licensing differs — AGPL-3.0 for Swetrix versus Apache-2.0 for Tianji. Swetrix is the more established project (first released 2021), while Tianji arrived in 2023. Tianji has the considerably larger community, at 3,100 GitHub stars versus 1,202.

Why pick each one

Choose Swetrix if…

  • No cookie banner needed
  • Detailed flow reports

Watch out for

  • Needs ClickHouse and Redis
  • Setup is multi-component
Swetrix details

Choose Tianji if…

  • Multiple tools in one
  • Clean interface

Watch out for

  • Jack-of-all-trades scope
  • Younger project
Tianji details

Frequently asked questions

Is Swetrix or Tianji better?

Neither is universally better. Tianji has the larger community; both share a medium setup difficulty, so the decision comes down to features and licensing.

Are Swetrix and Tianji free and open-source?

Yes. Swetrix is licensed under AGPL-3.0 and Tianji under Apache-2.0. Both can be self-hosted at no software cost.

Can I run Swetrix and Tianji with Docker?

Swetrix: yes. Tianji: yes.

Related comparisons