How to connect PostHog to Zendesk and see user activity on tickets

By Jake Marsh · Updated

To connect PostHog to Zendesk, create a personal API key in PostHog under Settings > User > Personal API keys, limit it to your project with the read scopes person, query, cohort and feature flag, and note your project id. Install Trailwell, set Analytics tool to posthog, choose the region (US Cloud, EU Cloud or self-hosted) and paste the key. The requester's PostHog person appears on every ticket, with cohorts and feature flags.

Steps

  1. Create the key. In PostHog, open Settings > User > Personal API keys and click Create. Name it "Trailwell for Zendesk".
  2. Limit it to your project, with the read scopes person, query, cohort and feature flag. Trailwell needs nothing else.
  3. Copy the key and note the project id (Settings > Project > General).
  4. Install Trailwell from the Zendesk Marketplace and choose Team (up to 12 agents and admins) or Scale (13 or more).
  5. Fill in the settings in Admin Center > Apps and integrations > Zendesk Support apps > Trailwell:
SettingWhat to enter
Analytics toolposthog
PostHog regionus, eu or custom
PostHog project idFrom Settings > Project > General
PostHog personal API keyFrom step 3. Stored as a Zendesk secure setting
Self-hosted addressOnly for custom: a host name like posthog.example.com
  1. Open a ticket from someone who uses your product.

How people are found

PostHog finds persons by the email property or by distinct id. Match by decides which Trailwell tries:

  • email (default): the requester's email addresses, primary first, at most 4.
  • external_id: the Zendesk user's External ID holds your product's distinct id.
  • both: external id first, then emails.

Several people match? Pick one. Nobody? Use Find another person.

What PostHog adds to the panel

PartWhat you see
Last seenActive today, Active this week, Quiet (7 to 30 days) or Dormant (over 30 days)
Sessions and eventsCounted on PostHog's side, exactly, for 7 days and your history window
Key eventsUp to 12 you name, with 7 and 30 day counts
ErrorsCounts and the latest ones, from your error events (default $exception, error*)
TimelineThe latest events, with the 24 hours before the ticket shaded
Cohorts and feature flagsPostHog only, on by default (Show cohorts and feature flags)

PostHog links to the person itself, so you don't need a Profile link.

Self-hosted PostHog

Set PostHog region to custom and enter your instance's host name in the self-hosted address setting, without https:// or a path. Zendesk sends the key only to that host.

Limits

PostHog allows 2,400 queries an hour on its query endpoint, and personal API keys also draw from an hourly read budget. Trailwell uses 2 queries per ticket, each limited to one person and your history window. Turn off Load usage automatically if you'd rather agents press Load only when they need usage.

What it costs

Trailwell is $100 per month for Zendesk accounts with up to 12 agents and admins (Team), or $9 per agent per month from 13 (Scale), billed monthly by Zendesk with a 14-day free trial and a card at install. See the Trailwell documentation and PostHog's API overview for personal API keys.

Trailwell

Mixpanel, Amplitude or PostHog usage on every ticket: last seen, key events, errors. From $100/mo. From $100 a month per Zendesk account.


Questions

Which PostHog scopes does the key need?

Read access for person, query, cohort and feature flag, limited to your project.

Does it work with PostHog EU Cloud?

Yes. Set PostHog region to eu.

Can agents see which feature flags a customer has?

Yes. With Show cohorts and feature flags on, the panel lists the person's cohorts and feature flags, which helps when a customer sees something others don't.

Does Trailwell send ticket data to PostHog?

It sends only the requester's email addresses or external id to your own project to find them. It writes nothing to PostHog.


More Trailwell guides


More Zendesk guides