Skip to main content

Overview

The PostHog integration provides comprehensive product analytics including page views, user sessions, feature flags, and custom event tracking.
What you’ll track:
  • Page views and sessions
  • Active users (DAU, WAU, MAU)
  • Custom events and conversions
  • Feature flag usage
  • User retention metrics
  • Funnel conversion rates

Prerequisites

Before connecting PostHog, ensure you have:
  • A PostHog account (Cloud or Self-hosted)
  • Admin access to your PostHog project
  • A Dashtray account (any tier)

Connection Steps

1

Navigate to Integrations

  1. Log in to your Dashtray account
  2. Click Integrations in the sidebar
  3. Find PostHog in the Product category
  4. Click Connect
2

Get PostHog API Key

  1. Go to PostHog Settings
  2. Navigate to Project API Key section
  3. Copy your Project API Key
Use your Project API Key, not your Personal API Key. Project keys have read-only access to analytics data.
3

Enter Credentials

In Dashtray:
  1. Paste your PostHog API Key
  2. Enter your PostHog instance URL:
    • Cloud: https://app.posthog.com
    • Self-hosted: Your custom domain
  3. Click Connect
4

Initial Data Sync

Dashtray will fetch:
  • Last 30 days of events
  • User metrics (DAU, WAU, MAU)
  • Custom events
  • Feature flag data
This usually takes 1-2 minutes depending on event volume.

Available Metrics

User Metrics

MetricDescriptionUnit
posthog_dauDaily Active Userscount
posthog_wauWeekly Active Userscount
posthog_mauMonthly Active Userscount
posthog_new_usersNew users todaycount

Event Metrics

MetricDescriptionUnit
posthog_eventsTotal events trackedcount
posthog_pageviewsPage viewscount
posthog_sessionsUser sessionscount
posthog_session_durationAverage session durationseconds

Feature Flag Metrics

MetricDescriptionUnit
posthog_feature_flagsActive feature flagscount
posthog_flag_evaluationsFlag evaluationscount

Custom Events

Track your custom events:
  • Sign ups
  • Conversions
  • Button clicks
  • Form submissions
  • Any custom event you’ve defined in PostHog

Webhook Setup (Optional)

PostHog doesn’t support outbound webhooks, but you can use manual refresh or scheduled syncs.

Troubleshooting

Connection Failed

Problem: API key authentication fails. Solutions:
  • Verify you’re using the Project API Key (not Personal API Key)
  • Check that the API key is active and not revoked
  • Ensure PostHog instance URL is correct
  • For self-hosted: Verify URL is accessible from internet

No Data Showing

Problem: Metrics are zero or outdated. Solutions:
  • Verify PostHog is receiving events from your application
  • Check that you have data in the selected time range
  • Click Refresh to trigger manual sync
  • Ensure API key has read permissions

Self-Hosted Connection Issues

Problem: Cannot connect to self-hosted PostHog instance. Solutions:
  • Ensure instance is publicly accessible
  • Check firewall rules allow incoming connections
  • Verify SSL certificate is valid (if using HTTPS)
  • Test API endpoint with curl:
curl -H "Authorization: Bearer YOUR_API_KEY" \
  https://your-posthog-instance.com/api/projects/@current/

Rate Limiting

Problem: Sync fails with rate limit error. Explanation:
  • PostHog API has rate limits (varies by plan)
  • High event volumes may hit limits during sync
Solutions:
  • Wait for rate limit to reset
  • Reduce sync frequency
  • Upgrade PostHog plan for higher limits

Data Refresh

Manual Refresh

Click Refresh on your dashboard to fetch the latest data from PostHog.
Manual refresh fetches the last 7 days of events to capture recent changes.

Automatic Sync

Automatic syncing is available on Pro and Scale tiers:
  • Pro tier: Every 3 hours
  • Scale tier: Every 30 minutes

Best Practices

1. Track Key Events

Focus on events that matter:
  • User sign ups
  • Feature usage
  • Conversion events
  • Critical user actions

2. Monitor User Retention

Track DAU, WAU, MAU to:
  • Understand user engagement
  • Identify retention issues
  • Measure product-market fit

3. Use Feature Flags

Monitor feature flag usage to:
  • Track feature adoption
  • A/B test effectiveness
  • Gradual rollout success

4. Set Up Alerts

Create alerts for:
  • Drop in DAU/MAU
  • Spike in error events
  • Low conversion rates
  • Feature flag issues

Security & Privacy

Data Access

Dashtray requests read-only access to:
  • Event data
  • User metrics (aggregated)
  • Feature flag data
  • Custom event definitions
We never access:
  • Individual user identities (unless you explicitly track them)
  • Personal data beyond what you send to PostHog
  • Session recordings
  • Raw event payloads

Credential Storage

  • API keys are encrypted with AES-256-GCM
  • Keys are stored securely in our database
  • You can revoke access anytime by regenerating your PostHog API key

Data Retention

Data retention depends on your tier:
  • Starter: 3 days
  • Basic: 30 days
  • Pro/Scale: Unlimited

Disconnecting

To disconnect PostHog:
  1. Go to IntegrationsPostHog
  2. Click Disconnect
  3. Confirm disconnection
Disconnecting will stop data syncing. Historical data will be retained according to your tier’s retention policy.
You can also revoke access by regenerating your API key in PostHog settings.

Next Steps

Create Product Dashboard

Build an analytics-focused dashboard

Set Up Alerts

Get notified of user behavior changes

Connect Stripe

Correlate revenue with user behavior

AI Insights

Ask questions about user behavior

Support

Need help with PostHog integration?