Product Benefits Pricing Guides Docs About Contact us Try it out
Analytics tools

PostHog Single-Script Install Event Tracking

PostHog's single-script web install queues calls while the SDK loads. Learn web analytics tracking steps to catch lost early events.

· 3 min read

Early events are the easiest ones to lose. A visitor lands, taps a button, and fires a capture call before your analytics library has finished downloading. With many installs, that call either fails or is dropped, and your first-touch data quietly goes missing. You only notice when the landing page funnel looks worse than the sales team says it should.

On 2 November 2026, PostHog announced that a single external script tag can initialise the web SDK and queue calls while the full client downloads. Existing installation paths keep working, so this is an option rather than a forced migration. The changelog does not name a configuration option, so check the PostHog libraries documentation for the exact snippet before you change anything.

Why This Matters

Web analytics has a loading problem. The fastest pages are the ones where visitors act earliest, which is exactly when a slow analytics script is most likely to miss them. A queue removes the race, but only if you can prove it works. Switching install methods also changes what the browser does on every page, so you need a before and after comparison.

Data Points to Track

  • install_method (snippet, package or single script), set as a super property
  • sdk_ready_ms: time from page start until the full client is ready
  • queued_call_count at the moment the full client loads
  • first_event_delay_ms: time between page start and the first captured event
  • pageview_capture_rate: pageviews captured divided by server-side page requests
  • bounce_rate and landing_page_conversion, split by install_method
  • script_load_failure with the browser and network type
  • consent_state when the first event is sent

Setup Steps

  1. Record a two-week baseline of pageviews, bounce rate and first-event delay before you change the install.
  2. Add install_method as a property on every event so old and new setups can be compared.
  3. Replace the current snippet with the single script tag on a staging site, following the PostHog docs.
  4. Fire a test capture call as early as possible in the page lifecycle and confirm it appears after the full client loads.
  5. Add a custom sdk_ready event with the load time, so slow starts are visible.
  6. Roll out to one section of the site or a share of traffic.
  7. Compare pageview capture against your server logs and check that consent handling still works.

Actionable Insights

If the pageview capture rate rises after the change, you were losing early events, and your historical bounce rate was probably overstated. Treat that as a measurement shift, not a performance gain, and annotate your dashboards on the release date.

If sdk_ready_ms is long on mobile networks, the queue is doing its job, but you should check how long events wait. A long queue on a slow connection means visitors can leave before anything is sent.

Watch consent_state. Queued calls made before a visitor chooses must follow your consent rules, so confirm the queue does not send anything it should not.

Segment by browser. In-app browsers and privacy-focused browsers often behave differently, and they are common on mobile traffic.

Common Mistakes to Avoid

Do not change the install method and the page design in the same release. Do not compare week-over-week numbers across the switch without a note. Do not assume a queue is lossless; verify it against server logs.