本文へスキップ
Skillpedia
テスト41k · #6986

simulate-new-user

できること

このスキルは、初回訪問者を装った訪問をWebページに送り、PostHogがどのイベントを記録するかを確認します。新規訪問者に対してトラッキングが動いている証拠がほしい開発者向けです。

使う場面

  • ✓初めて訪れた人のページビューが記録されるかを確認したいとき。
  • ✓トラッキングの変更をデプロイして、テストしたいとき。
  • ✓新規ユーザーにイベントが表示されないという報告があったとき。

スキルのリンク

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

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/PostHog/posthog/blob/master/tools/traffic-sim/skills/simulate-new-user/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“価格ページに、新規訪問者としていくつかテスト訪問を送り、PostHogが記録しているか教えてください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

エージェントは、保存されたCookieのない新しいブラウザで、ページを何度か開きます。各訪問では少しスクロールし、PostHogが受け取ったイベントを報告します。ページビューが取得された場合に、その訪問は検証済みとなります。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)を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.
よくある質問

毎回新しいブラウザを使うのはなぜですか?

各訪問を、PostHogから見て完全に新しい匿名の訪問者に見せるためです。

テストにはどれくらい時間がかかりますか?

各訪問に約10秒と、訪問間の待ち時間がかかるため、数回の訪問でも少し時間がかかります。

EUのPostHogクラウドをテストできますか?

はい。このスキルは、EUクラウドまたはセルフホストのPostHogのアドレスに訪問を送れます。

詳細

作者による元の説明

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

人気

GitHubのスター
41k
ランキング
#6986
ライセンス
—
更新日
2026/11/2

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル