Skip to content
Skillpedia
Testing41k · #6985

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.md

Copy 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

Use this skill to help me: https://github.com/PostHog/posthog/blob/master/tools/traffic-sim/skills/check-posthog-loading/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

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.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.
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

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills