Product Analytics with PostHog
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:| Event | Description | Properties |
|---|---|---|
payment.completed | Successful payment | amount_minor, currency, method |
payment.failed | Failed payment | reason, amount_minor |
transfer.completed | Bank transfer completed | amount_minor, destination |
card.issued | New card created | cardType, tier |
kyc.verified | KYC verification passed | tier, documents |
user.signed_up | New user registration | channel, referral |
session.authenticated | User logged in | method, deviceType |
Configuration
1. Get Your PostHog API Key
- Sign up at posthog.com or self-host
- Create a new project
- Copy your Project API Key
2. Configure in Backend
Add your PostHog credentials to your environment:Custom Events
From Your Backend
Add custom events from your application code:From Your Frontend
Install the PostHog JavaScript SDK:Building Dashboards
Conversion Funnel
Track your payment conversion funnel:- Go to Insights → New Insight → Funnel
- Add steps:
payment.pendingpayment.completed
- Filter by
payment.methodto compare channels
User Cohorts
Create cohorts based on behavior:Retention Analysis
Measure user retention:- Go to Insights → Retention
- Set Starting event:
user.signed_up - Set Return event:
payment.completed
Feature Flags
Use PostHog feature flags to control rollouts:Best Practices
Use Consistent Event Names
Use Consistent Event Names
Follow a naming convention like
noun.verb (e.g., payment.completed, card.issued). This makes filtering and analysis easier.Include Relevant Properties
Include Relevant Properties
Always include properties that help with analysis:
amount_minorandcurrencyfor transactionsplatform(ios/android/web) for multi-platform appsuser_tierfor segmentation
Respect User Privacy
Respect User Privacy
Don’t track personally identifiable information (PII) in event properties. Use user IDs instead of emails in event data.
Set Up Alerts
Set Up Alerts
Configure alerts for anomalies:
- Payment failure rate spikes
- Drop in daily active users
- Unusual transaction volumes
Related Resources
PostHog Docs
Official PostHog documentation
Tenant Analytics API
Programmatic access to your metrics