New to Claude Skills? Learn how to install them →

posthog on GitHub

Simulate New User Traffic

Free

Test anonymous visitor tracking with synthetic traffic.

by posthog37.6k stars on posthog/posthog
1 views
Updated Aug 11, 2026
Get this skill

Free · Opens the source repo

What Simulate New User Traffic does

Simulate New User Traffic is a tool designed for developers and product teams who need to verify the functionality of their PostHog analytics implementation. By generating synthetic first-time visitor traffic to a specified URL, this skill helps ensure that your tracking setup is working as intended. Each simulated visit is treated as a brand-new anonymous user, allowing you to test how your application responds to fresh traffic without any influence from cookies or local storage.

The skill operates by creating a fresh browser context for each visit, which means that it can accurately simulate the experience of a new user. It navigates to the specified URL, performs some basic interactions such as scrolling, and then reports back on the PostHog events that were triggered during the visit. This is particularly useful for confirming that the $pageview event fires correctly on the first visit and that an anonymous distinct_id is generated as expected.

In scenarios where users report that events are not showing up for new visitors, this tool can be invaluable. By reproducing these conditions, you can quickly identify whether the issue lies within your PostHog setup or if there are other factors at play. The structured results returned from the tool provide clear insights into the success of the simulated visits, including the number of events fired and any errors encountered.

This skill is ideal for teams that are deploying instrumentation changes or need to troubleshoot event tracking issues. It allows for efficient testing and validation of analytics setups, ensuring that your data collection is reliable and accurate before going live.

When to use it

Use this skill when you need to confirm that your PostHog implementation is capturing events for new users.

When not to use it

This tool is not suitable for testing user interactions beyond pageviews or for scenarios involving logged-in users.

What you can build with it

Testing PostHog Implementation

Use this skill to confirm that your PostHog setup is correctly capturing `$pageview` events after making changes to your analytics code.

Debugging Event Tracking Issues

When users report that events are not showing up, simulate new user traffic to reproduce the issue and identify potential problems.

Validating Instrumentation Changes

After deploying updates to your tracking setup, use this tool to ensure that the new instrumentation is functioning as expected.

How to install Simulate New User Traffic

View source

1. Install with the skills CLI

npx skills add posthog/posthog/simulate-new-user --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by posthog

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.

Frequently asked questions about Simulate New User Traffic

Similar skills