selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

Traffic Source logo

Self-host Traffic Source

Open-source analytics tracking visits and revenue

ReleaseOpen SourceMIT
Updated6 months ago
LanguageJavaScript
Setup difficultyModerate
Stars
679
Port
3000 (HTTP web server)
Requires
Node.js
Install with Linux
Traffic Source screenshot 1

What is Traffic Source?

Traffic Source is a self-hosted web analytics platform built with Next.js 16 and React 19 that tracks visitor traffic, referrers, UTM parameters, and conversions. It uses SQLite as a zero-config database with WAL mode, requiring no external database server. Key capabilities include real-time analytics with live visitor counts, traffic source breakdowns with UTM parameters, geo tracking via Cloudflare proxy headers, device and browser analytics, Google Search Console integration for keyword data, Stripe conversion tracking that polls payments every 60 seconds without webhooks, an affiliate system with custom commission rates and public dashboards, visitor journey session replays, and multi-site tracking from a single dashboard. The tracking script is ~3KB with SPA support. Deployment options include a one-click Railway deploy or manual VPS setup with Node.js 20+, PM2 for process management, and Nginx reverse proxy. The cloud version at piqo.app offers a managed alternative with pricing tiers. The project is MIT licensed.

Should you self-host Traffic Source?

Traffic Source scores 51/100 on selfhost.directory (how scoring works) and ranks #10 of 27 in Analytics. It has 679 GitHub stars.

There was no stable release in the past 12 months, so check the repository's recent activity before you rely on it.

Setup is moderate: expect some configuration beyond a single command. It is MIT-licensed and written mostly in JavaScript.

Its closest alternative on selfhost.directory is PostHog (81/100, 40 487 stars). It scores higher overall, so compare the two before you pick. See Traffic Source vs PostHog side by side.

Features

  • Affiliate System
  • Automatic database migrations
  • Device and browser analytics
  • Geo Tracking
  • Google Search Console integration
  • Lightweight tracking script
  • Multi-site tracking
  • One-click Railway deploy
  • Privacy-first tracking
  • Real-Time Analytics
  • SQLite Database
  • Stripe conversion tracking
  • Traffic source tracking
  • Visitor journey replay
  • Zero-Downtime Deployments

Traffic Source README

How to install Traffic Source

Install Traffic Source with Linux

Environment variables
JWT_SECRET (required), JWT_EXPIRY (default 7d), NEXT_PUBLIC_APP_URL (required), DATABASE_PATH (default ./data/analytics.db), CRON_SECRET (optional)

git clone https://github.com/mddanishyusuf/traffic-source.git cd traffic-source npm install cp .env.local .env.production

Edit .env.production with JWT_SECRET, NEXT_PUBLIC_APP_URL, etc.

npm run build npm start

For production with PM2:

npm install -g pm2 pm2 start npm --name "trafficsource" -- start pm2 startup pm2 save

Requires Node.js 20+, Cloudflare account for geo data

How to configure Traffic Source

  • CRON_SECRETSecret for protecting cron endpoints

    Secret for protecting cron endpoints

  • DATABASE_PATH./data/analytics.dbPath to SQLite database file

    Path to SQLite database file

  • JWT_EXPIRY7dAuth token expiry duration

    Auth token expiry duration

  • JWT_SECRETRandom hex string for signing auth tokens

    Random hex string for signing auth tokens

  • NEXT_PUBLIC_APP_URLPublic URL of your Traffic Source instance

    Public URL of your Traffic Source instance

More in Marketing Automation

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…