Documentation index for AI agents (llms.txt)
Skip to main content

PostHog

Measure how people use your site with events, funnels and session replays, in your own PostHog project.

Connect​

  1. Open Settings > Connectors, click PostHog, then Connect.
  2. PostHog opens. Sign in and approve access for WebTwizz.
  3. Under Finish connecting, pick the PostHog project.

WebTwizz works out whether your project is on PostHog's US or EU cloud and sets the host for you. No keys to copy. PostHog goes into your project's connector code and only runs on your published site, so your own visits to the preview don't count.

What you see​

PostHog people over 7 days, events, replays and top events
  • People, last 7 days: people by day. Open PostHog opens your project.
  • People, Events and Session replays, each opening PostHog.
  • Top events: your most frequent events and their counts, each opening in PostHog. All events opens the full list.
  • Problem pages, last 7 days: pages where visitors rage click, click things that do nothing or hit errors, with how many people it happened to. Ask the AI to fix opens a new chat where the AI finds what's broken or confusing on that page and fixes it. Only shows when PostHog has seen any.
  • Session replays: the latest recordings, each with the page it started on, how long it lasted, its clicks and errors, and when. Watch opens one in PostHog, All replays opens the full list, and Show more loads 10 more. Only shows when there are some.
  • Feature flags: each flag and who gets it: Off, on for a share of people, or on for people matching its conditions. Open opens a flag in PostHog, and All flags opens the full list.
    • The switch turns a flag on or off. Your live site changes right away, so it asks first: click Turn on or Turn off to confirm.
    • Rollout changes the share of people who get a flag. Type a percentage, click Save, then Change rollout to confirm. Flags that decide by conditions don't have it. Change those in PostHog.
    • No switch? The account was connected before WebTwizz could change flags, so connect PostHog again.
  • Settings:
    • PostHog project: where this site's events are sent. Pick another project to switch.
    • Live site: Running, Publish to update or After you publish.
The PostHog account and the PostHog project setting

What the AI can do​

  • Read how many people came, how many events they sent and the top events, for any period up to 90 days
  • Read your feature flags: which are on and how far each is rolled out
  • Turn a feature flag on or off. It asks first, and only does it after you click Accept.

Secrets​

  • NEXT_PUBLIC_POSTHOG_KEY: your project API key, safe to use in the browser
  • NEXT_PUBLIC_POSTHOG_HOST: https://us.i.posthog.com or https://eu.i.posthog.com, matching your project

Good to know​

  • PostHog accounts connected before the overview arrived don't have permission to read your data. The connector says PostHog needs one more permission. Click Connect again and approve, and your events keep flowing the whole time.
  • Removing PostHog from a project takes both secrets out. Your PostHog project and events are untouched.