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

check-posthog-loading

できること

このスキルは、PostHogのJavaScriptライブラリが各ページで正しくインストールされ設定されているかを、ページの一覧で確認します。どのページでもトラッキングが動いていることを確かめたいサイト運営者向けです。

使う場面

  • ✓PostHogをインストールしたばかりで、すべてのページで動いているか確認したいとき。
  • ✓ページテンプレートが変わり、1つのページからトラッキングのスニペットが抜けたかもしれないとき。
  • ✓一部のページだけ、別のPostHogプロジェクトやホストにデータを送っているとき。

スキルのリンク

https://github.com/PostHog/posthog/blob/master/tools/traffic-sim/skills/check-posthog-loading/SKILL.md

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

使い方

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

貼り付け用メッセージ

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

AIへの頼み方の例

“主要なページでPostHogが正しくインストールされ、同じプロジェクトにデータを送っているか確認してください。”

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

仕組み

エージェントは、実際のブラウザで各ページを開き、PostHogが起動するまで待ってから、読み込まれたか、どの方法で追加されたか、使っている設定を報告します。その後、問題のないページと問題のあるページを要約します。

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

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

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が読み込まれたか、どの方法で追加されたか、プロジェクトキーとホスト、そして割り当てられたユーザーIDが表示されます。

どのページも読み込まれない場合はどういう意味ですか?

トラッキングのスニペットがサイトにない可能性が高いので、再インストールするか、ページのレイアウトを確認するのが次の手順です。

どの設定を比較しますか?

プロジェクトキーとホストを比較するので、別の場所にデータを送っているページを見つけられます。

詳細

作者による元の説明

Inspect how the PostHog JavaScript SDK is loaded across a list of URLs. Use to confirm consistent installation across pages, find pages missing the snippet, detect mismatched API keys or hosts between pages, and verify the load method (head snippet vs deferred vs array.js).

repo: PostHog/posthog

人気

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

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

0

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

コメント

  • …

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

似ているスキル