Skip to content
Skillpedia
Testing41k · #6986

simulate-new-user

What it does

This skill sends simulated first-time visits to a web page and checks which PostHog events fire. It is for developers who want proof that tracking works for new visitors.

When to use it

  • ✓When you want to confirm that pageviews are tracked for first-time visitors.
  • ✓When you have deployed a tracking change and want to test it.
  • ✓When people report that events are not showing up for new users.

Skill link

https://github.com/PostHog/posthog/blob/master/tools/traffic-sim/skills/simulate-new-user/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/PostHog/posthog/blob/master/tools/traffic-sim/skills/simulate-new-user/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“Please send a few test visits to our pricing page as a new visitor and tell me whether PostHog records them.”

5 new skills a week. 1 minute to read.

How it works

The agent opens the page several times, each time in a fresh browser with no saved cookies, scrolls a little, and reports which events PostHog received. A visit counts as verified when a pageview is captured.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Simulate new-user traffic

Drives a fresh browser context for each visit (no cookies, no localStorage), goes to the given URL, scrolls a bit, and reports which PostHog events fired. Each visit looks to PostHog like a brand-new anonymous visitor.

When to use

  • Confirm $pageview fires on the first visit (no cookies present).
  • Confirm an anonymous distinct_id is generated and a PostHog request is sent within a few seconds of page load.
  • Reproduce "events not showing up for new users" reports.

How to invoke

Call the simulate_new_user MCP tool with:

  • url (required) — the page to visit, e.g. https://example.com/pricing.
  • visits (default 3) — number of fresh-context visits.
  • interval (default 5.0) — seconds between visits.
  • posthog_host (default https://us.i.posthog.com) — set to https://eu.i.posthog.com for the EU cloud, or your self-hosted host (e.g. https://ph.example.com).

Each visit takes ~10s of Playwright time plus the interval, so plan accordingly.

Interpreting the result

The tool returns a structured summary:

{
  "run_id": "a1b2c3d4",
  "scenario": "new-user",
  "total_visits": 3,
  "posthog_requests": 6,
  "posthog_requests_ok": 6,
  "events_by_type": { "$pageview": 3, "$autocapture": 3 },
  "pageviews": 3,
  "errors": [],
  "verified": true,
}
  • verified: true means at least one $pageview was captured per visit and no errors occurred — the new-user flow works.
  • verified: false with pageviews: 0 means PostHog isn't firing pageviews. Run check_posthog_loading next to see whether the snippet is even loaded.
  • posthog_requests_ok < posthog_requests means PostHog returned non-2xx responses. Check the project's ingestion limits and api_host configuration.
FAQ

Why use a fresh browser each time?

It makes each visit look like a brand-new anonymous visitor to PostHog.

How long does a test take?

Each visit takes about ten seconds plus the wait between visits, so a few visits take a little while.

Can I test the EU PostHog cloud?

Yes. The skill can send visits to the EU cloud or to a self-hosted PostHog address.

Details

Original description by the author

Send synthetic first-time-visitor traffic to a URL and confirm that PostHog $pageview events fire. Use when a customer wants to verify that anonymous visitor tracking works, after deploying instrumentation changes, or when debugging "events not arriving" reports.

repo: PostHog/posthog

Popularity

GitHub stars
41k
Ranking position
#6986
License
—
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills