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がスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
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.posthogis defined and__loaded. - Which load method was used:
head_snippet,snippet,array_js_only, ornone. - 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_hostorapi_keythan 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(defaulthttps://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
loadedlist, fullnot_loadedlist — 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_keyvalues across pages — a page is pointing at the wrong PostHog project. - Multiple distinct
api_hostvalues — 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_onlywith no init config —array.jswas loaded butposthog.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
コメント
- …
このリポジトリの他のスキル
depot-ci
41kエージェントが、GitHub Actionsの代替であるDepot CIのワークフローを設定し実行できるよう支援します。既存のワークフローの移行や、実行ログの確認も含みます。
depot-container-builds
41kエージェントが、Depotのリモート・ビルダーでDockerイメージを作れるよう支援します。マルチプラットフォームのイメージ、レジストリへのプッシュ、ビルド失敗の修正を含みます。
depot-github-runners
41kエージェントが、GitHub Actionsのジョブを Depot が管理するランナーに移し、ランナーのサイズとラベルを選び、ランナー設定の問題を解決できるよう支援します。
editing-agents-md
41kエージェントが、AGENTS.mdとCLAUDE.mdのどちらにルールを書くべきかを判断し、ファイルを膨らませずに守られやすい形で書けるよう支援します。
似ているスキル
test-driven-development
311k機能や修正を作る前に、まず失敗するテストを書き、それが失敗するのを確認してから、合格させる最小のコードを書くようエージェントに教えます。
verification-before-completion
311kタスク、修正、ビルドが完了した、または合格したと主張する前に、実際のチェックを実行し、その出力を読むようエージェントに教えます。
migrate-to-shoehorn
310kテストファイル内の危険な型キャストを、shoehornライブラリに置き換え、テストが部分的なデータを使いつつ型チェックを通るようにします。