Connect your Mixpanel project to export router exposure data for analysis and import your product events to define custom metrics in Portal.Documentation Index
Fetch the complete documentation index at: https://docs.inworld.ai/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Find your Mixpanel Project ID

Create a service account

+ button to create your new service account. Set the Project Role to Admin or Owner. Set Expires to Never.Click Add and copy the username and secret — you will not be able to view the secret again.Configure the integration in Portal

| Field | Value |
|---|---|
| Project ID | Your Mixpanel project ID from Step 1 |
| Service Account Username | The service account username from Step 2 |
| Service Account Secret | The service account secret from Step 2 |
Exporting to Mixpanel
Toggle Export to Mixpanel on in the Data Sync section of your integration settings. When enabled, router exposure data is automatically sent to your Mixpanel project.Make a request to your router
Call the Chat Completions API with your router, populating the Mixpanel Distinct ID that corresponds to the user in theuser field:
user to the Mixpanel Distinct ID when creating events in Mixpanel, so you can tie the specific request to the right user.
View events in Mixpanel
The router exposure data will flow to your Mixpanel project automatically (data syncs every ~8 hours). You will see an event for each router, route, and variant that a user was exposed to every hour. Each event will include:alias_id— Your router’s IDroute_id— The route that the user was routed tovariant_id— The variant that the user was exposed toTime— The time of the most recent event in the hourly bucket in which the user was exposed to this router, route, and variant
user field of the request.

Analyze your data
We recommend creating a Borrowed Event Property. To do so, create a Custom Event Property and select Computed > Borrow Property. Select theInworld Router Exposure event and alias_id, route_id, or variant_id based on what property you want to analyze your data by.

Importing from Mixpanel
Toggle Import from Mixpanel on in the Data Sync section to start pulling your product events into Portal.Define events to import
In the Events to import section that appears after enabling import, click Add Event and configure:| Field | Description | Example |
|---|---|---|
| Event ID | The Mixpanel event name to import. Must exactly match the event name in your Mixpanel project. | purchase |
| Description | Optional description of when this event is emitted. | Fires when a user completes a purchase |
Event IDs can only contain letters, numbers, underscores, and hyphens.
How import works
- Inworld uses the same service account credentials configured in Prerequisites to read events from your Mixpanel project.
- Events are synced approximately every 8 hours.
- User identity is matched using the Mixpanel Distinct ID. To correlate imported events with router exposures, ensure the same user identifier is passed as the
userfield in your Chat Completions API requests and as the Distinct ID in your Mixpanel events. - Once events are imported, their properties are automatically discovered and become available for metric configuration.