check-posthog-loading
What it does
This skill checks a list of web pages to confirm PostHog's JavaScript library is installed and set up correctly on each one. It is for site owners who want to be sure tracking works everywhere.
When to use it
- ✓When you have just installed PostHog and want to confirm it works on every page.
- ✓When a page template changed and you suspect one page lost the tracking snippet.
- ✓When some pages send data to a different PostHog project or host than others.
Skill link
https://github.com/PostHog/posthog/blob/master/tools/traffic-sim/skills/check-posthog-loading/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Please check my key pages to make sure PostHog is installed correctly and sending to the same project.”
5 new skills a week. 1 minute to read.
How it works
The agent opens each page in a real browser, waits for PostHog to start, and reports whether it loaded, how it was added, and the settings it uses. It then summarizes which pages are fine and which are not.
Technical content (original SKILL.md)
Original text by the author, straight from 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.
FAQ
What does the report show for each page?
Whether PostHog loaded, how it was added, the project key and host, and the user ID it assigned.
What does it mean if no pages load?
The tracking snippet is probably missing from the site, so reinstalling it or checking the page layout is the next step.
Which settings does it compare?
The project key and host, so you can spot pages that send data somewhere else.
Details
Original description by the author
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
Popularity
- GitHub stars
- 41k
- Ranking position
- #6985
- License
- —
- Updated
- 11/2/2026
Comments
- …
More skills from this repository
depot-ci
41kHelps your agent set up and run Depot CI workflows, a GitHub Actions alternative, including migrating existing workflows and reading run logs.
depot-container-builds
41kHelps your agent build Docker images on Depot's remote builders, including multi-platform images, pushing to registries, and fixing build failures.
depot-github-runners
41kHelps your agent move GitHub Actions jobs to Depot-managed runners, choosing runner sizes and labels, and troubleshooting runner setup issues.
editing-agents-md
41kHelps your agent decide whether a rule belongs in an AGENTS.md or CLAUDE.md file, and write it so it sticks without bloating the file.
Similar skills
test-driven-development
311kTeaches your agent to write a failing test first, watch it fail, then write the smallest code that passes, before building any feature or fix.
verification-before-completion
311kTeaches your agent to run real checks and read their output before claiming that a task, fix, or build is complete or passing.
migrate-to-shoehorn
310kReplaces risky type casts in your test files with the shoehorn library, so tests can use partial data and still pass type checks.