check-posthog-loading

作成者: posthog

PostHog JavaScript SDKがURLリスト全体でどのように読み込まれているかを検査します。ページ間での一貫したインストールを確認したり、スニペットが欠落しているページを見つけたりするために使用します。

npx skills add https://github.com/posthog/posthog --skill check-posthog-loading

Check PostHog loading

For each URL, navigates a real browser to the page, waits for PostHog to initialize, and reports:

  • Whether window.posthog is defined and __loaded.
  • Which load method was used: head_snippet, snippet, array_js_only, or none.
  • Where in the document the snippet lives (head / body).
  • The init config: api_key, api_host, person_profiles.
  • Runtime state including the assigned distinct_id.

When to use

  • Sanity-check a fresh install — does the snippet actually load on every page?
  • After a page-template change — did one page lose the snippet?
  • When investigating split data — are some pages pointing at a different api_host or api_key than others?
  • Onboarding a new customer — confirm SDK is wired up before debugging events.

How to invoke

Call the check_posthog_loading MCP tool with:

  • urls (required) — list of URLs to inspect.
  • posthog_host (default https://us.i.posthog.com).

Returns a structured summary with which URLs loaded successfully, which didn't, and the load-method distribution.

Interpreting the result

Look for these red flags:

  • Empty loaded list, full not_loaded list — snippet not present anywhere. Re-run install or check that the layout includes the snippet.
  • Mixed loaded / not_loaded — snippet missing from some pages. Common cause: a page rendered by a different template or layout.
  • Multiple distinct api_key values across pages — a page is pointing at the wrong PostHog project.
  • Multiple distinct api_host values — a page is pointing at the wrong ingestion endpoint (e.g. EU cloud vs US cloud, or vs a self-hosted reverse proxy). This causes events to land in different projects than expected.
  • load_method: array_js_only with no init config — array.js was loaded but posthog.init() was never called. Common with manual installs that miss the second half.

posthogのその他のスキル

error-tracking-hono
posthog
PostHogのHono向けエラートラッキング
tuning-incremental-sync-config
posthog
同期の設定はExternalDataSchemaに保存され、external-data-schemas-partial-updateを使用していつでも変更できます。ほとんどの変更は非破壊的(次の同期で反映)ですが、一部(sync_typeの切り替え、プライマリキーの変更)は、同期データの破損を防ぐために慎重な対応が必要です。
playwright-test
posthog
Playwrightテストを作成し、それが確実に実行され、かつ不安定でないことを確認してください。
error-tracking-ruby
posthog
PostHogのRuby向けエラートラッキング
authoring-log-alerts
posthog
PostHogプロジェクト内のサービスに対して、有用でノイズの少ないログアラートを作成します。ユーザーがログのアラート設定を依頼したり、追加すべきアラートを提案するよう求めた場合に使用します。
making-scenes-tab-aware
posthog
Guides converting PostHog frontend scenes to be tab aware for internal scene tabs. Use when adding or refactoring a `SceneExport` scene, fixing state leaking…
posthog-survey-creator
posthog
PostHogでガイド付き会話を通じてサーベイを作成・設定します。ユーザーがサーベイを作成したり、ユーザーフィードバックを収集したり、実行したい場合にこのスキルを使用します。
authoring-scouts
posthog
PostHog Signalsスカウト(プロジェクトをスキャンしてSignals受信箱にレポートを書き込むスケジュールエージェント)を作成、編集、適応する方法。ユーザーが…の場合に使用します。