Skip to main content
Zentra integrates with PostHog for product analytics, enabling you to track user behavior, analyze conversion funnels, and make data-driven decisions.
PostHog integration is available for all Zentra tenants. Events are automatically captured from the Zentra backend, and you can add custom events from your application.

What Gets Tracked

Zentra automatically sends the following events to PostHog:

Configuration

1. Get Your PostHog API Key

  1. Sign up at posthog.com or self-host
  2. Create a new project
  3. Copy your Project API Key

2. Configure in Backend

Add your PostHog credentials to your environment:
The Zentra Backend will automatically start sending events once configured.

Custom Events

From Your Backend

Add custom events from your application code:

From Your Frontend

Install the PostHog JavaScript SDK:
Initialize and track events:

Building Dashboards

Conversion Funnel

Track your payment conversion funnel:
  1. Go to InsightsNew InsightFunnel
  2. Add steps:
    • payment.pending
    • payment.completed
  3. Filter by payment.method to compare channels

User Cohorts

Create cohorts based on behavior:

Retention Analysis

Measure user retention:
  1. Go to InsightsRetention
  2. Set Starting event: user.signed_up
  3. Set Return event: payment.completed

Feature Flags

Use PostHog feature flags to control rollouts:

Best Practices

Follow a naming convention like noun.verb (e.g., payment.completed, card.issued). This makes filtering and analysis easier.
Always include properties that help with analysis:
  • amount_minor and currency for transactions
  • platform (ios/android/web) for multi-platform apps
  • user_tier for segmentation
Don’t track personally identifiable information (PII) in event properties. Use user IDs instead of emails in event data.
Configure alerts for anomalies:
  • Payment failure rate spikes
  • Drop in daily active users
  • Unusual transaction volumes

PostHog Docs

Official PostHog documentation

Tenant Analytics API

Programmatic access to your metrics