Verify posthog instrumentation

From PostHog/posthog · View interactive version

Verify posthog instrumentation is an AI agent skill from the GitHub repository PostHog/posthog. Use this skill to verify that PostHog instrumentation is firing correctly on a website. Drives a real browser at one or more URLs, observes which PostHog events actually arrive, and reports a pass/fail summary. Use after installing the PostHog SDK on a site, after a deploy that touches tracking code

How to use this skill

Skill file

Verify PostHog instrumentation

End-to-end check that the PostHog SDK is loaded and emitting events as expected.

This skill orchestrates the three traffic-sim tools to give a complete picture

of a site's instrumentation health.

When to use

between snippet issues, network issues, or filtering issues.

Workflow

Step 1 — Confirm the snippet is loaded everywhere

Run the check_posthog_loading MCP tool against the URLs you care about

(homepage, key product pages, login, checkout, marketing pages). It returns

which pages have PostHog initialized, the load method (head_snippet / snippet

/ array_js_only), and the init config.

Look for:

Step 2 — Send synthetic traffic and confirm events arrive

Pick one URL where Step 1 confirmed PostHog is loaded. Call:

fires for first-time visitors and that an anonymous distinct_id is assigned.

cookies persist and $pageview keeps firing across navigations.

The tools return verified: true when at least one $pageview was captured

and there were no errors.

Step 3 — Cross-check in PostHog

If Steps 1 and 2 pass but events don't show up in the PostHog UI, the issue

is downstream of the snippet:

What "verified" means in this skill

A site is verified when:

  1. check_posthog_loading reports loaded: true on every URL we expect.
  2. simulate_new_user and simulate_returning_user both return at least one

$pageview event per visit, with no errors.

  1. (Optional) The events appear in the PostHog UI within 1-2 minutes.

What this skill does not check

the tool watches for any PostHog event, but you'd need to drive the actual

user flow to see custom events fire. Use it as a starting point, then add

user-flow simulation on top.

in the init config but doesn't validate the recording itself.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.