Skip to main content

Prerequisites

The connector should already be set up, with a Connector Profile and a Linked Account. See Getting Started on the PostHog connector page.

How PostHog webhooks are set up

StackOne creates and manages the PostHog webhook destination for you. When you connect a PostHog account, StackOne creates an HTTP Webhook destination in your project and points it at its own delivery URL. When you disconnect the account, StackOne archives that destination. There is nothing to paste into PostHog by hand.

1

Grant the Hog function scope on your personal API key

The personal API key you connect with must be allowed to manage destinations. Without it, StackOne cannot create the webhook destination and the connection fails with API key missing required scope 'hog_function:write'.

  • In PostHog, open Settings from the bottom of the left sidebar, then select Personal API keys under the Account section
  • Click the name of the key you use for StackOne to open it
  • Find the Hog function row in the Scopes list and set it to Write
  • Click Save
  • Scopes can be added or revoked on an existing key, so you do not need to create a new one
2

Set the Project ID on the connection

A PostHog destination belongs to a single project, so StackOne needs to know which project to create it in.

  • Open your PostHog dashboard and read the numeric project ID from the URL, for example /project/12345
  • Enter it in the Project ID field on the StackOne connection
3

Check your PostHog plan

Webhook destinations are part of PostHog’s data pipelines product and are not available on the free plan. Confirm your project has data pipelines enabled before connecting.

4

Find the destination in PostHog

After the account is connected, the destination StackOne created is visible in your project.

  • In the left sidebar open Data pipeline, then Destinations
  • Look for the destination named StackOne Events, described as Forwards PostHog events to StackOne
  • Click its name to open the configuration, where the Webhook URL and Filters StackOne set are shown
  • Use the Testing section at the bottom of that page to send a sample event, and the Metrics and Logs tabs to check deliveries
  • The webhook URL, request body and headers are managed by StackOne - do not change them, or deliveries will stop reaching StackOne
  • The Filters list is safe to edit, and is where you add your own custom events. Note that reconnecting the account recreates the destination with only the nine system events, so re-add any custom matchers afterwards

Available webhook events

The following PostHog events can be enabled in StackOne. PostHog forwards all nine system events below to StackOne, and your event selection in StackOne then controls which of them reach your integration. Your own custom events are different - PostHog does not send those at all until you add them to the destination’s filter, as described under Your own events.

1

Page and screen events

Events captured when a visitor views or leaves a page or screen.

  • Pageview ($pageview) - Fired when a page is viewed on the web
  • Page Leave ($pageleave) - Fired when a visitor leaves a page, used to measure time on page and bounce rate
  • Screen View ($screen) - Fired when a screen is viewed in a mobile app, the mobile equivalent of a pageview
2

Interaction events

Events captured from user interactions without custom instrumentation.

  • Autocapture ($autocapture) - Fired when a click, form submission, or input change is auto-captured, including the element chain describing what was interacted with
3

Person and group events

Events that create or update person and group profiles.

  • User Identified ($identify) - Fired when an anonymous visitor is linked to a known distinct ID
  • Person Properties Set ($set) - Fired when properties are written onto a person profile
  • Group Identified ($groupidentify) - Fired when a group such as an account, company, or workspace is created or its properties change
4

Feature flag events

Events captured when feature flags are evaluated.

  • Feature Flag Evaluated ($feature_flag_called) - Fired when a feature flag is evaluated for a user, recording the flag key and the variant returned. Drives experiment exposure
5

Error events

Events captured by PostHog error tracking.

  • Exception Captured ($exception) - Fired when an error is captured, including the exception type, message, and stack trace
6

Custom events

Your own product events, such as user_signed_up or purchase_completed.

  • Custom (any non-system event name) - Fired when a custom event is captured. The original event name is preserved in the payload
  • Custom events are not delivered until you add them to the destination’s filter in PostHog. Open Data pipeline > Destinations > StackOne, click Add event matcher in the Filters section, select each event name, then click Save
  • Event names are case-sensitive, so user_signed_up and User_Signed_Up are different events.

Verify

Your Connector should now be able to receive and process events. Try triggering an event and you should see an Event appear in the Connector logs.