This guide walks you through the full Replit + PostHog analytics stack. By the end you'll have an analytics dashboard for viewing your data, a reverse proxy that shields your analytics from ad blockers, and an AI skill that lets Replit Agent set up PostHog automatically in any project.

replytics.gif



Overview

The stack has three pieces that work together:

Component What it does Template link
PostHog Proxy Routes analytics traffic through your own domain so ad blockers can't intercept it Fork on Replit
Replytics Dashboard A full analytics dashboard (React + Express) that reads from your PostHog project via the API Fork on Replit
PostHog Skill A SKILL.md file you drop into any Replit project so the Agent can wire up PostHog automatically SKILL.md

You can use each piece independently or combine all three for a complete setup.

Prerequisites

Before you start, make sure you have:

  1. A PostHog account — sign up free at posthog.com. Note which region you're on (US or EU).
  2. A PostHog Personal API Key — go to PostHog → Settings → Personal API Keys and create one. This key has broad permissions and must stay server-side.
  3. Your PostHog Project ID — the number in your PostHog project URL (e.g. the 12345 in us.posthog.com/project/12345).
  4. Your PostHog API Hosthttps://us.posthog.com for US, https://eu.posthog.com for EU. This is for server-side API calls (fetching tokens, querying data, managing projects).
  5. Your PostHog Ingest Hosthttps://us.i.posthog.com for US, https://eu.i.posthog.com for EU. This is where the browser SDK sends events. (If you deploy the proxy from Part 1, you'll use your proxy URL instead.)

Part 1 — PostHog Proxy

Why use a proxy?

Ad blockers routinely block requests to posthog.com and us.i.posthog.com. A reverse proxy routes that traffic through your own domain, so analytics requests look like first-party traffic and aren't blocked. This dramatically improves data accuracy.