Skip to main content
Version: Config V2

Mixpanel - Monitor your feature flag change events and feature flag analytics

Overview

There are two available integration opportunities between ConfigCat and Mixpanel:

Monitoring your feature flag change events in Mixpanel with Annotations

Ensures that every setting change in ConfigCat is sent to Mixpanel as an Annotation.

Mixpanel Annotation

Installation

  1. Have a Mixpanel account.
  2. Create a Service account that has at least an Analyst role. mixpanel_service_Account
  3. Open the integrations tab on the ConfigCat Dashboard.
  4. Click on Mixpanel's CONNECT button and set your Mixpanel Service Account's Username, Secret, and your Project ID.
  5. OPTIONAL - Set the proper server of your Mixpanel account. More about Mixpanel servers.
  6. You're all set. Go ahead and make some changes on your feature flags, then check your annotations in Mixpanel.

Un-installation

  1. Open the integrations tab on the ConfigCat Dashboard.
  2. Click on Mixpanel's DISCONNECT button.

Annotation details

Every annotation sent to Mixpanel by ConfigCat has:

  • Integration ID: configcat.
  • Date: When the change happened
  • Description: A brief summary of the change.

Sending feature flag evaluation analytics to Mixpanel Experiments

Ensures that feature flag evaluations are logged into Mixpanel Experiments. With this integration, you can have advanced analytics about your feature flag usages, A/B test results.

Setup

  1. Install SDKs: Add both the ConfigCat SDK and Mixpanel SDK to your application.
  2. Configure SDKs:
    • ConfigCat SDK: Initialize with your ConfigCat SDK key.
    • Mixpanel SDK: Set up with your Mixpanel token.
  3. Integrate Feature Flag Evaluations:
    • During the initialization of the ConfigCat SDK, subscribe to the flagEvaluated hook.
    • Send feature flag evaluation data to Mixpanel using the $experiment_started event name. Include the following parameters:
      • Experiment name: the feature flag's key.
      • Variant name: the evaluated feature flag's value or variation ID
      • Variation ID (optional): the evaluated feature flag's variation ID
    • You can use the Identify API in Mixpanel to enrich all your events with feature flag metadata. This way you can easily group/filter your existing Mixpanel events by feature flag evaluations.

Code samples:

const configCatClient = configcat.getClient("#YOUR_SDK_KEY", PollingMode.AutoPoll, {
setupHooks: (hooks) =>
hooks.on('flagEvaluated', evaluationDetails => {
// Send an `$experiment_started` event.
mixpanel.track('$experiment_started',
{
'Experiment name': evaluationDetails.key,
'Variant name': evaluationDetails.value,
'Variation ID': evaluationDetails.variationId
});

// Use the identify API.
mixpanel.people.set({ ["configcat_" + evaluationDetails.key]: evaluationDetails.value });
}),
});
note

For Text feature flags with lengthy values (e.g., JSON), send the variationId instead of the value as the Variant name to Mixpanel. The variationId is a hashed version of the feature flag value, accessible on the ConfigCat Dashboard by enabling the Show VariationIDs to support A/B testing setting. Learn more here.

  1. Deploy your application and wait for feature flag evaluations to happen so Experiments in Mixpanel could be populated.

Usage with Experiments

Check your Experiments page in Mixpanel, select your feature flag as the Experiment.

Mixpanel Experiments report

Usage with Insights report

If you don't have access to the Experiments feature in Mixpanel, you can create a custom Insights report based on the Experiment Started event. You can filter for your feature flag keys with the Experiment name property and visualize the different variants by using the Variant name property as a Breakdown. Example:

Mixpanel Insights report

Usage with enriched user properties for your custom events.

If you use the Identify API approach, you'll be able to use the feature flag evaluation data in your current reports. Example with a Breakdown:

Mixpanel Insights report with enriched data