PostHog Destination
Step-by-step guide to integrating Ours Privacy with PostHog for HIPAA-compliant product analytics — funnels, retention, cohorts, and dashboards — without sending PHI directly from the browser.
PostHog Features
The Ours PostHog integration lets you use PostHog's product analytics — funnels, retention, cohorts, and dashboards — while staying in full control of the PII and PHI that leaves your environment. Ours forwards the events you already track (along with user and group properties) into PostHog as first-class captured events, so your product team gets the insights they need without raw patient data ever being sent directly from the browser.
You can redact, hash, or suppress sensitive fields before they reach PostHog, and choose exactly which events are forwarded through your Allow List.
What you can do with this integration
- Build funnels, retention, and cohorts in PostHog using the events you already track in Ours.
- Keep PostHog Person profiles up to date by syncing user properties as events flow through.
- Attribute events to a company, account, or organization with PostHog Group Analytics.
- Use PostHog's GeoIP and browser enrichment so location and device reports work as expected, with the visitor's IP under your control.
What this integration does not include
PostHog is a broad platform, and a few of its features rely on PostHog's browser SDK running directly on the page. These are not reproduced by this server-side integration:
- PostHog Web Analytics (bounce rate, session length, pageview ranking).
- A/B testing and feature flags.
- Session replay.
- Autocapture of clicks, form changes, and submissions.
If you need any of the above, you can install the PostHog browser SDK alongside this destination — the two are designed to coexist.
Adding PostHog as a destination
To add a destination, click on Destinations from your Ours platform. Click the Add destination button and select PostHog as the destination type.
Then enter your Project API Key, choose your Region (US Cloud or EU Cloud), and press Save.
Find your PostHog Project API Key
- Log into your PostHog project.
- Navigate to Project settings.
- Copy the Project API Key (it starts with
phc_).
If you self-host PostHog, leave the region as US Cloud and use the optional API Endpoint field to point Ours at your PostHog host (for example, https://posthog.example.com).
Sending User Properties
All events in your Allow List configured to send to this destination will be sent with their event data, including any tracked event properties. Toggling this ON will also send any tracked user properties, which keep PostHog Person profiles up to date. Toggling this OFF will not send any tracked user properties.
Group Analytics
If you use PostHog Group Analytics, you can attribute each event to a group (such as an account, organization, or company) so funnels and metrics can be measured per-group. The group types you map here must already be enabled in your PostHog Group Analytics settings.
When It Dispatches
Our PostHog integration dispatches events automatically when the required data properties are present. Specifically:
-
Necessary Properties: An event will be dispatched if it includes a valid PostHog Project API Key and configuration for the destination. Visitor information must also be present so PostHog can associate the event with a Person profile.
-
Event Type: Dispatch occurs for all event types configured within your PostHog setup, including a built-in mapping that forwards Ours' standard
page_viewevent as PostHog's native pageview so pageview reports work without any extra setup. -
Automatic Retry: If the PostHog API encounters a temporary error, the system will automatically attempt to re-dispatch the event. Non-retryable errors, such as missing configuration, will prevent further attempts.
This setup ensures events are only dispatched when sufficient data is present, enabling reliable tracking and insights within your PostHog dashboards.
Privacy and Compliance
This integration runs through Ours Privacy's standard event pipeline, so PHI fields can be redacted, hashed, or suppressed before they ever reach PostHog. You control which events are forwarded through your Allow List, and the visitor's IP is sent in a way that lets PostHog perform GeoIP enrichment without exposing your server's IP — and can be modified or removed entirely using Ours' standard IP controls.
Get Started Today
Implement Ours Privacy effortlessly with our simple copy-and-paste installation script. Begin optimizing your product analytics and tracking insights without compromising privacy.
How is this guide?