A tracking script is code that runs on every page you own. If it changes unexpectedly, you have a security problem. If it is blocked to protect you, you have a data problem. Pinning a hash solves the first and can quietly create the second, because a browser that rejects a script does not send your team an email. It just stops sending events.
On 6 November 2026, PostHog announced that browser SDK installs can pin a SHA-384 hash for the core script that the static loader downloads. If the bytes have been modified, the browser rejects them instead of loading them. The changelog does not name the option used to set the hash, so follow the PostHog libraries documentation for the exact syntax.
Why This Matters
Hash pinning is good practice, but it creates a new failure mode. When PostHog publishes a new core script and your pinned hash is out of date, every visitor on that page can lose analytics until you update it. Without monitoring, the first sign is an empty dashboard.
Data Points to Track
integrity_check_result(passed, failed, not supported)pinned_hash_versionor the SDK version the hash belongs tosdk_load_success_rate, measured outside the SDKevents_per_page_request: captured events against server-side page requestsscript_error_typefrom the browser’s error handlerbrowser_name,browser_versionandin_app_browserflagcsp_violation_countif you use a content security policytime_to_detect_minutesfor each incident
Setup Steps
- Record your normal ratio of captured pageviews to server-side requests as a baseline.
- Add a lightweight error listener that reports a script load failure to a separate, minimal endpoint, since the SDK itself will not be running.
- Pin the SHA-384 hash in a staging environment, using the method in the PostHog documentation.
- Test with a deliberately wrong hash and confirm the browser blocks the script and your listener reports it.
- Deploy to production behind a small traffic share.
- Add an alert for a drop of more than 20% in the capture ratio over an hour.
- Add a checklist item to your upgrade process: update the pinned hash whenever you change the SDK version.
Actionable Insights
A sudden drop in the capture ratio right after a deploy usually means a stale hash. Compare it with the time of your last SDK or loader change.
A steady failure rate on one browser points to a compatibility problem, not an attack. Test the affected version and decide whether to serve a fallback.
Failures that appear on a single page suggest a different script version was hard-coded there. Search your templates for old tags.
Keep a log of every integrity failure. Even if each one turns out to be a mistake, a pattern shows where your release process leaks.
Common Mistakes to Avoid
Do not pin a hash without a way to detect failures. Do not rely on the SDK to report its own load failure. Do not forget to update tag managers and test pages that load the same script.