PostHog with Astro
See what somebody did before they signed up, then connect that activity to who they become in your product. Events, campaign attribution, identity, session replay and feature flags, set up as one system rather than five installs.
PostHog at a glance
- What I do
- Connect Astro to PostHog so marketing visits, signup behavior and product activation can be read as one funnel.
- Typical setup
- Adds 2–4 days
- How it is bought
- Part of a migration scope, or a Continuous development request once the site is yours
- Category
- Analytics and data
Setup
How I set up PostHog
The useful question is not how many people saw pricing. It is which pricing visitors later signed up, activated and stayed. That only works if the marketing site and product agree on identity.
I fire the important events explicitly: form submitted, demo requested, signup started, plan clicked. Autocapture can still help discovery, but it should not be the only source of truth.
Session replay is handled carefully. Recording every visitor on every page creates privacy risk and hours of footage nobody watches. Scoped to key pages, with masking and consent rules, it can answer real conversion questions.
How the handoff works
- 01
Event
Named, fired deliberately on the page
- 02
Anonymous ID
The visitor before they are anybody
- 03
Campaign
Parameters carried through to signup
- 04
Signup
The anonymous history aliased to the account
Key handoff
- 05
One person
Pre-signup activity joined to the user in the product
Why this is the key handoff
The join is the whole job. Somebody's anonymous marketing activity should still belong to them after they become a product user. Every step succeeds on its own either way, which is why I check the alias at the point of signup rather than taking the default: the failure is silent, and it only shows up when somebody asks which page produced an activated user.
Included
What gets connected
-
Explicit marketing events for the actions that matter
-
Anonymous-to-known identity flow across the site and the product
-
Campaign parameters carried into signup
-
Session replay and feature flags scoped to where they are useful
-
Consent-aware loading and capture rules
Before you add it
What to watch out for
- 01
Feature flag flicker
A flag resolving in the browser renders the default first and swaps afterward, which on a hero is a visible flash and a layout shift counted against the page. I test the initial resolution and the identity change.
- 02
Brittle autocapture
Events keyed to DOM structure change meaning when somebody restyles a section, so a small set of named events holds up better across a redesign.
- 03
Broken identity joins
Pre-signup activity can start a second history instead of joining the known user. I test that it joins, and check the expected volume against how the account is priced.
More tools
Keep exploring
-
Google Analytics
GA4 and Tag Manager set up on an Astro site with clean events, consent behavior and performance-conscious loading.
Adds 2–4 days
-
Segment
Send one event stream into the tools that need it, with consistent naming, a shared identity plan and destinations chosen deliberately.
Adds 3–6 days
-
Airtable
Keep content operations in Airtable and render the website in Astro, with field mapping, rebuild triggers and clear publishing status.
Adds 3–6 days
Let me plan your next step.
I can scope a migration. Send a brief and I will reply by email with next steps.