# PostHog Integration

> Connect your PostHog instance as the primary data source for behavioral signal detection. Backtest hypotheses on your event history before any signal goes live.

*Source: [https://www.getbeton.ai/integrations/posthog/](https://www.getbeton.ai/integrations/posthog/)*

**Category:** source
**Vendor URL:** https://posthog.com

## How it works

1. **Connect your PostHog instance** — Provide your PostHog project API key. Beton connects directly to your instance — Cloud or self-hosted. No data export, no migration.
2. **Agent proposes signal hypotheses** — The agent reads your event taxonomy and person/group properties, then proposes hypotheses (e.g. "users who hit 5+ workspace events in their first session convert at 4× baseline").
3. **Backtest before promotion** — Each hypothesis is scored on your last 90 days of events: precision, recall, lift. Approve a hypothesis once it clears your bar — only then does it route signals.

## Features

- Direct API connection — no data export needed
- Real-time event processing on a sync schedule (every few minutes)
- Supports all PostHog event types and properties
- Historical backtesting on the last 90 days of events
- Zero impact on your PostHog performance — read-only, batched, rate-limit-aware
- Works with PostHog Cloud and self-hosted

## Use cases

- Detect when free users exhibit buying behavior in your product
- Identify power users ready for expansion conversations
- Spot churn signals before users downgrade or leave
- Route product-qualified leads to your sales team automatically

## Sample payload

```json
{
  "hypothesis_id": "hyp_8g2k",
  "hypothesis": "Users who invite a teammate within 7 days of signup",
  "backtest": {
    "window_days": 90,
    "precision": 0.71,
    "recall": 0.42,
    "lift_vs_baseline": 4.3,
    "sample_size": 1284
  },
  "status": "approved"
}
```

## FAQ

### Do I need to export my PostHog data to use Beton?

No. Beton reads events directly from your PostHog instance via the API — PostHog Cloud or self-hosted both work. Nothing is copied or migrated. You provide connection credentials and can revoke access at any time.

### Does Beton slow down my PostHog instance?

No. Beton queries event batches on a schedule (typically every few minutes) rather than streaming every event, and respects PostHog's rate limits. In practice the read load is a few queries per sync interval.

### Which PostHog event types does Beton analyze?

Beton reads standard event types (pageviews, custom events, group events, identify calls) plus person and group properties. The agent proposes hypotheses automatically — you don't need to pre-define which events matter.

### Does Beton store the raw PostHog events?

No. Beton reads events, computes signals, and stores only the signal output (type, confidence, events referenced). Granular product analytics data stays in PostHog.
