# Swetrix or traffic-source

Privacy-friendly analytics and affiliate/Stripe attribution without Google Analytics or Mixpanel.

**Replaces:** Google Analytics / Mixpanel

**Tier:** Easy

## Problem

Google Analytics is a compliance headache. Mixpanel is a bill that scales with events. Neither tells a small shop which affiliate or Stripe checkout actually paid the rent.

## Stack

- [Swetrix](https://github.com/Swetrix/swetrix) — Self-hosted analytics
- [traffic-source](https://github.com/mddanishyusuf/traffic-source) — Analytics plus affiliate / Stripe attribution
- [Umami](https://umami.is/) — Minimal pageview analytics (Dave stack — add; not in the Crew DB)

## Estimated SaaS cost saved

| You stop paying | Typical / year | Self-host instead |
|---|---:|---|
| Mixpanel Growth | $12,000 | Swetrix or Umami + Postgres |
| GA360 / extra attribution tools | $2,400 | traffic-source for Stripe + affiliates |

**About $12,000 / year** on a small team, before you count lock-in.

## Deploy on Railway

Placeholder: Swetrix as the alternate first Railway template if the AI chat box slips. Pair with a /data volume.

## AGENT_PROMPT

```
Stand up self-hosted product analytics that replaces Google Analytics and Mixpanel.

Preferred: Swetrix (https://github.com/Swetrix/swetrix). Alternate: traffic-source for affiliate and Stripe attribution, or Umami if you only need pageviews.
- One public site, cookieless or first-party.
- Persist Postgres (or the app's DB) on Railway.
- Give the operator a snippet to paste on c17.io and a note on how to read campaigns vs. organic.
- Document GDPR/CCPA posture in one paragraph.
```

## FAQ

### Will this replace Mixpanel funnels?

For a content + checkout site, yes. For a consumer app with 40 event types, start with Swetrix and add a warehouse later.

### Is SEO covered?

traffic-source shows which campaigns and affiliates converted. Pair it with server-rendered pages, sitemap.xml, and llms.txt — which this site already ships.

Source: https://c17.io/stacks/swetrix-analytics
