Trimtab

Blog / Measuring in PostHog and Stripe

PostHog tutorial: from install to your first funnel in one hour

Create a project, install posthog-js or run the wizard, check events in Activity, add three custom events, then build and save a signup to activation funnel.

To get from zero to a working funnel in PostHog, create a project in the right region, install posthog-js (or let the wizard do it), confirm events arrive in the Activity tab, add three custom events for the steps autocapture cannot see, then build a funnel insight and save it to a dashboard. That fits in an hour for a web SaaS where you can ship a code change the same day.

Most PostHog tutorials stop at "events are flowing". This one ends with a funnel you can read and act on, and flags the settings that quietly distort it.

The hour, step by step

MinutesStepDone when
0 to 5Create the project, pick US or EUYou have a project token and a host
5 to 20Install the SDKThe code is merged on a branch
20 to 25Check events arriveYour own pageview shows in Activity
25 to 45Add three custom events and identifyEach event appears with its properties
45 to 60Build the funnel and save itA dashboard shows signup to activation

The middle step is the one that slips. If your signup and activation logic lives on the server, budget extra time for the backend events.

Step 1. Create the project and pick the region

Sign up on PostHog Cloud and create a project. A project lives in the US or the EU cloud, and that region decides the host your code sends to. The install guide uses https://us.i.posthog.com and says to use https://eu.i.posthog.com for an EU project. A host that does not match the project's region is one of the causes PostHog's troubleshooting page lists for events that never show up.

Copy the project token from the project settings. It goes in your front-end code, in the init call below.

Step 2. Install: the wizard or by hand

The wizard. Run npx -y @posthog/wizard@latest in your project folder. PostHog describes it as an agentic CLI that installs the SDKs, writes the .env file with your credentials, instruments client and server, creates custom events "based on real product flows" and generates insights and dashboards. It supports Next.js, React, Vue, SvelteKit, Django, Rails, Laravel and a long list of other stacks. Treat its output as a pull request from a new teammate: read every event it adds and delete the ones you will never chart.

By hand. Install the package and initialize it once, as early as possible in your app, following the JavaScript SDK docs:

npm install --save posthog-js@1
import posthog from 'posthog-js'

posthog.init('<ph_project_token>', {
  api_host: 'https://us.i.posthog.com', // eu.i.posthog.com for an EU project
  defaults: '2026-08-30',
})

The defaults option is a date that switches on the default behaviors PostHog introduced up to that date. Any value from 2025-05-24 on records a pageview on every client-side route change, which a single-page app needs. Use the date the docs show when you install, and only move it after reading the changelog for the dates in between.

On Next.js, the setup has a few specifics (an instrumentation-client.ts file, server events with posthog-node, a reverse proxy). The PostHog Next.js guide covers them.

Step 3. Check that events arrive

Open your app in a browser without an ad blocker and click around. Then open the Activity tab in PostHog. Its Live view shows events as they are captured, and you can expand any event to see its properties and raw JSON. You should find a $pageview and some $autocapture events from your own session.

If nothing shows up after a minute, check in this order:

  1. Ad blockers. The troubleshooting page says plainly that PostHog can be blocked, even locally. Test in a clean browser profile, and set up a reverse proxy before you go to production.
  2. Region. The host in your code matches the project's region.
  3. Debug mode. Append ?__posthog_debug=true to your URL, or set debug: true in init during development, and read the SDK logs in the console, as the usage docs describe.

Step 4. Add the three events your funnel needs

Autocapture records clicks on links, buttons and form fields, form submissions and changes, without form values. That is enough for a marketing funnel: you can turn a click on your "Start free trial" button into an action, and actions are retroactive, so they also apply to clicks captured before you defined them.

A product funnel needs facts that happen in your code: an account was created, a user reached the moment of value. Add three custom events, named in the "object verb" pattern the usage docs suggest:

posthog.capture('user signed up', { signup_method: 'email' })
posthog.capture('project created')
posthog.capture('report shared') // your activation event

Replace the last two with your own setup and activation events. If you have not chosen your activation event yet, the guide to defining your activation rate helps, and the SaaS tracking plan lists the events worth adding per funnel stage. Send the events that prove something happened (account created, payment) from the server when you can, because a blocked browser never sends them.

Then call posthog.identify(user.id) right after signup and login, before the signup event fires. Without it, the visitor who landed on your pricing page and the user who signed up are two people, and the funnel breaks at signup. PostHog identify explains where each call goes. Check in Activity that each new event arrives with its properties.

Step 5. Build the funnel

The funnels docs describe the path: in Product analytics, create a new insight and pick Funnel. Then:

  1. Add the steps. For example $pageview on your pricing page, user signed up, project created, report shared. Keep it to the path you want people to take. The docs warn that optional steps filter out users and skew results.
  2. Keep sequential order. It is the default: step B must come after step A, with any events in between. Strict order (nothing in between) is rarely what a SaaS funnel means. Any order suits steps that really have no sequence.
  3. Set the conversion window yourself. It is the time a user has to finish the funnel after the first step. Anyone slower counts as a drop-off. Match it to your product: a few days for a self-serve tool, longer if activation depends on a teammate or a data import.
  4. Pick a date range that leaves room. The date range applies to every step, so someone who entered on the last day of the range and converted the next day does not count.
  5. Read both conversion modes. Overall conversion compares each step to the first one. Relative to the previous step shows where the biggest single drop is.

Two more settings are worth a click on day one. A breakdown by an event or person property, such as signup_method, splits the funnel by segment. Exclusion steps remove people who did something between two steps, for example users invited by a teammate if you want to measure self-serve signups only.

Save the insight, then click Add to dashboard. A dashboard can start blank or from a template, and the same insight can sit on several dashboards.

Reading your first funnel

The first funnel is mostly a data quality check. A step at 100 percent of the previous one usually means two events fire together. A drop to near zero at signup usually means identify runs too late. Fix those before you read anything into the numbers.

Once the data holds, switch the graph type. Time to convert shows which steps take longest, which the docs call the steps with the highest friction. Historical trends shows conversion per entry date, so you can see whether last week's onboarding change moved anything.

Then pick one step. The useful question about a funnel is which single gap, if closed, would add the most paying customers, and what that is worth. Multiply the users who drop at a step by the conversion rate of the steps after it and by your average revenue per customer, and you have a rough value for fixing that step. Compare it across steps, pick the largest, and work on it for a week. Then open the funnel again and check whether that step moved.

Where to go after the first hour

  • Retention. A funnel shows whether people get to value once. The guide to measuring retention in PostHog shows whether they come back.
  • SQL. When an insight cannot express your question, HogQL queries the same events in SQL.
  • Cost. Identified events cost more than anonymous ones. The PostHog pricing guide works through what a SaaS pays at different volumes.

What to remember

Pick the region first and match the host to it. Install with the wizard or by hand, then prove events arrive in Activity before you write anything else. Add the three custom events autocapture cannot see, call identify before the signup event, and build a sequential funnel with a conversion window you chose on purpose. The hour ends when one dashboard shows signup to activation and you have named the step you will work on next.

Frequently asked questions

How long does it take to set up PostHog?

The install itself takes minutes: one npm package and an init call, or the wizard command, which edits your code for you. The rest of the first hour goes to checking that events arrive, adding the few custom events your funnel needs, and building the funnel. Plan more time if events must come from your backend.

Is autocapture enough to build a funnel in PostHog?

For a funnel across marketing pages, often yes: pageviews and clicks are captured by default, and actions let you name autocaptured clicks and apply them to past events. For a product funnel from signup to activation, send custom events such as user signed up, because those facts happen in your code and on your server.

Should I use the PostHog wizard or install manually?

The wizard is the fastest route on a supported framework: it installs the SDK, writes the init code, creates custom events from your product flows and builds insights. Review its diff like any pull request. Install manually when you want to choose every event yourself or your stack is not on the supported list.

Why does my PostHog funnel show fewer users than expected?

Check four things: the date range applies to every step, so late steps outside it do not count; users who finish after the conversion window count as drop-offs; sequential order requires steps in the right order; and events captured under two unlinked IDs split one person in two, which identify fixes.

Sources

  1. PostHog docs, Install PostHog: https://posthog.com/docs/getting-started/install
  2. PostHog docs, AI wizard: https://posthog.com/docs/ai-engineering/ai-wizard
  3. PostHog docs, JavaScript web SDK: https://posthog.com/docs/libraries/js
  4. PostHog docs, JavaScript configuration: https://posthog.com/docs/libraries/js/config
  5. PostHog docs, JavaScript usage: https://posthog.com/docs/libraries/js/usage
  6. PostHog docs, Autocapture: https://posthog.com/docs/product-analytics/autocapture
  7. PostHog docs, Actions: https://posthog.com/docs/data/actions
  8. PostHog docs, Activity tab: https://posthog.com/docs/activity
  9. PostHog docs, Product analytics troubleshooting: https://posthog.com/docs/product-analytics/troubleshooting
  10. PostHog docs, Funnels: https://posthog.com/docs/product-analytics/funnels
  11. PostHog docs, Dashboards: https://posthog.com/docs/product-analytics/dashboards
Colas VandervaereHead of Growth, building Trimtab

Read next