Skip to main content
Use this recipe when Mixpanel is the analytics client your app already imports and calls from product code. There are two supported paths:
  • event-triggered interviews from the app’s existing mixpanel.track(...) calls;
  • synced cohort prompts from Mixpanel cohorts imported into UserJourneys.
The interview SDK does not replace Mixpanel. Your app still tracks product events in Mixpanel, and UserJourneys decides which configured events or synced cohorts should show an interview prompt.

Wrap the exported Mixpanel client

Create the interviews client in the same module where you export your Mixpanel instance.
analytics.ts
Your existing product code keeps using the exported client:

What UserJourneys receives

For event-triggered launches, UserJourneys receives only:
  • the event name;
  • the referenceId configured on the SDK;
  • the primitive metadata returned by mapTrackProperties;
  • app-level metadata, if configured.
Nested Mixpanel payloads, private provider fields, tokens, emails, and raw user profiles are not forwarded unless you explicitly map them.

Sync Mixpanel cohorts

For cohort-based prompts, configure Mixpanel to send saved cohort membership to the UserJourneys Mixpanel cohort sync endpoint. UserJourneys stores active audience members and Study Launch Rules connect those audiences to studies. The mobile app does not call Mixpanel cohort APIs and does not carry private Mixpanel credentials. It only sends the public SDK key and the current referenceId when loading config. See Audience prompts for the runtime flow, and Study Launch Rules to connect a synced audience to a study.

Mount the interview UI

Mount the host once near your app root. It owns the built-in prompt and the full-screen WebView.
AppRoot.tsx
When Interview config has an active trigger for a Mixpanel event, the SDK creates a pending invite and the host shows the native prompt. Starting the prompt opens the web interview in-app.