Goodbye Google Analytics: Why I Self-Host Plausible for Privacy, Speed, and AI Agents

GG
Blog Post

How I migrated dozens of domains to self-hosted Plausible Analytics for $10/month, gaining better privacy, 20% more accurate data, and a clean API for AI agents.

For years, Google Analytics (GA) was the default. You spun up a site, you pasted the tracking code, and you forgot about it. But the web has changed. Between GDPR, cookie consent banners that ruin UX, and the bloated complexity of GA4, the "default" choice has become a liability.

Over the last year, I migrated dozens of domains to Plausible Analytics. It's open-source, lightweight, and privacy-friendly. But more importantly, I'm self-hosting it for roughly $10/month, and it has become a secret weapon for AI Agents (marketing strategies, segmentation, etc)

Here's why Plausible is superior to Google Analytics, Matomo, and Cloudflare, and how you can run it yourself.

1. The Tech Stack: Built for Speed

Unlike legacy PHP applications, Plausible is built on a modern, high-performance stack:

  • Elixir & Phoenix Framework: Known for handling massive concurrency with low latency.
  • ClickHouse: A columnar database used for the analytics data. This makes querying millions of rows instant.
  • PostgreSQL: Used for standard relational data (user accounts, site settings).

This architecture is why the dashboard loads instantly, even with millions of hits.

Plausible Analytics Dashboard

2. Privacy by Design (No Cookie Banners!)

The biggest user experience killer on the modern web is the "Accept Cookies" banner. Plausible eliminates this entirely.

How it works without cookies:

Plausible does not use cookies or local storage. Instead, it generates a daily identifier using a one-way hash:

hash(daily_salt + website_domain + ip_address + user_agent)
  • No Persistent Storage: Raw IPs are never stored.
  • 24-Hour Rotation: The salt rotates daily. If I visit your site today and again tomorrow, I am counted as a unique visitor both times. This prevents long-term user profiling.
  • Compliance: It is GDPR, CCPA, and PECR compliant out of the box. You don't need a cookie banner.

3. Data Accuracy: The "Ad-Blocker" Effect

You might think Google Analytics is the "source of truth," but it's actually lying to you.

Ad-Blockers: Because GA is ubiquitous and invasive, almost every ad-blocker blocks it.

The Plausible Advantage: Plausible is lightweight and privacy-focused. When self-hosted on your own domain (e.g., p.yourdomain.com), it looks like first-party traffic.

Result: Studies show Plausible captures 20-25% more traffic than GA. When you factor in users rejecting cookie banners, GA4 can miss up to 55% of your actual visitors.

4. The "Killer Feature": AI Agent Integration

This is where Plausible shines for modern development. If you're building AI Agents that need to make decisions based on site performance, GA4 is a nightmare of complex APIs, sampling, and rate limits.

Why Plausible is better for AI:

  • Clean Data Structure: The API is simple. No complex "event parameters" or "dimensions" to wrangle. Your AI gets clean JSON.
  • No Sampling: GA4 samples data when you hit certain limits. Plausible gives you 100% real data, every time.
  • Speed: Thanks to ClickHouse, API responses are near-instant, allowing Agents to make real-time decisions.
  • EU AI Act Compliance: The EU AI Act requires training data to be free of bias and errors. Because Plausible strips personal data before storage, you're feeding your AI "clean," compliant data, reducing legal risk.

5. Self-Hosting for $10/mo (Kubernetes Config)

You don't need to pay SaaS pricing to own your data. Plausible is incredibly efficient. I run this on a small cluster, and the resource usage is negligible.

Here's the exact configuration I use to run Plausible, ClickHouse, and Postgres.

The Database Layer (Postgres & ClickHouse)

We use bitnami legacy images to keep things stable and lightweight. Note the resource limits we're running on mere megabytes of RAM.

# postgres-values.yaml
postgresql:
  enabled: true
  image:
    repository: bitnamilegacy/postgresql
  primary:
    resources:
      requests:
        cpu: 100m
        memory: 256Mi
      limits:
        memory: 512Mi
  persistence:
    enabled: false

# clickhouse-values.yaml
clickhouse:
  enabled: true
  global:
    security:
      allowInsecureImages: true
  image:
    repository: bitnamilegacy/clickhouse
  auth:
    username: *********
    password: *********
    database: plausible_events_db
  initdbScripts:
    db-init.sql: |
      CREATE DATABASE IF NOT EXISTS plausible_events_db
  initContainers: []
  shards: 1
  replicaCount: 1
  resources:
    requests:
      cpu: 200m
      memory: 512Mi
    limits:
      memory: 1Gi
  zookeeper:
    enabled: false
  persistence:
    enabled: true
    size: 10Gi
  volumePermissions:
    enabled: false
    image:
      repository: bitnamilegacy/os-shell
  extraConfiguration:
    memory_settings.xml: |
      <yandex>
          <profiles>
              <default>
                  <max_bytes_before_external_group_by>600000000</max_bytes_before_external_group_by>
                  <max_bytes_before_external_sort>600000000</max_bytes_before_external_sort>
                  <max_memory_usage>900000000</max_memory_usage>
              </default>
          </profiles>
      </yandex>

The Application Layer

This connects the app to the databases and exposes it via Ingress.

# plausible-values.yaml
image:
  repository: ghcr.io/plausible/community-edition
  tag: "v2.1.0"

service:
  type: ClusterIP
  port: 80

ingress:
  enabled: true
  hosts:
    - p.yourdomain.ai
  tls:
    - secretName: yourdomain-tls
      hosts:
        - p.yourdomain.ai

resources:
  requests:
    cpu: 100m
    memory: 256Mi
  limits:
    memory: 512Mi

Summary: The ROI is Clear

FeatureGoogle Analytics 4Plausible (Self-Hosted)
Data OwnershipGoogle owns itYou own it
Cookie BannerRequired (Legally)Not Required
Script Size~45KB+< 1KB
Ad-Blocker ResistantNoYes
AI IntegrationComplex, SampledSimple, 100% Accurate
CostFree (you pay with privacy)~$10/mo (Server costs)

By switching to Plausible, I improved my site speed, removed annoying banners, gained 20% more data visibility, and gave my AI agents a clean, fast API to work with. All for the price of two coffees a month.

Published on 12/5/2025by Claudio Teixeira