# Overview: Metric Builder for Mixpanel (Segmentation)

## How to access the Metric Builder for Mixpanel (Segmentation)

![](/assets/overview-metric-builder-for-mixpanel-segmentation_1.ea2ccea53edff18fa77d764529e3d13859ba6e68a2ca5b50fa9ba849584a7545.4783b0ec.gif)

Navigate to **Custom****Metrics >**  to access the Metric Builder for Mixpanel (Segmentation). Click the green **+ New Custom** **Metric**button and select your connected Mixpanel Account from the **Data Source** drop-down list. Select the **Segmentation** radio button.

## How to use the Metric Builder for Mixpanel (Segmentation)

![](/assets/overview-metric-builder-for-mixpanel-segmentation_2.8b66e3eeac14256816e40f3e99e56f067049fab1f8d02ae159dc97864119c725.4783b0ec.png)

- **A) Custom Metric Name**: Enter a name for your Custom Metric. This Custom Metric name will be available in the Designer after saving.
- **B) Event**: Select an Event from your connected Mixpanel Data Source. The Event options will depend on the Events configured within your Mixpanel Account.


To report on Custom Events, select Custom Event as the Event. This will expose the Custom Event ID field. Here, you can directly enter the Custom Event ID.

- **C) Metric Operation**: The Metric Operation field determines how the system will handle multiple results that are returned from the Mixpanel Account. Selecting **SUM** will instruct Databox to add together all Event Values that are returned. Selecting **Count** will instruct Databox to count 1 for each result returned, regardless of the specific Event Value.
- **D) Filter by (Optional)**: Filters restrict the data that gets included in the Custom Metric. All data that is returned is tested against the Filter(s). Multiple Filters can be combined using AND/ OR boolean logic.
If the data synced from the Event field meets the Filter specifications, the data is retained and included in the Custom Metric value. If the data synced from the Event field doesn't meet the Filter specifications, the data is excluded from the Custom Metric value.
- **E)** **Date Range**: Select up to 8 Date Ranges that will be available for the Custom Metric. The Date Ranges selected are the only periods of time that data is synced for this Custom Metric.
- **F) Compare With (Optional)**: Select a comparison period to measure each Date Range against, like "Previous Period." Data for the comparison period will be synced for each Date Range that is selected.
This data can be used on a Line Chart or Bar Chart to show past performance. It is also used to calculate the percentage growth or loss of the current Date Range performance vs the comparison Date Range performance. If no Compare With parameter is selected, comparison percentages cannot be displayed for the Custom Metric.
- **G) Unit (Optional)**: Select the Unit, which determines the buckets that the property value are grouped into.
- **H) Type (Optional)**: Choose "Total," "Unique," or "Average" as the Type. If Type is set to "Total," we return the total count of Events, including any repeats. If Type is set to "Unique", we return the unique count of Events returned. If Type is set to "Average," the average count of Events is returned.
- **I) Data Preview**: After clicking **Preview data**, a Data Preview of the Custom Metric will be displayed. Daily Metric values are displayed in this section, along with the total Metric values for the Date Range in bold at the bottom. You can view the Data Preview for different Date Ranges by clicking on the tabs at the top of the Data Preview.


## How to create a Custom Mixpanel Metric [Example]

In this example, we'll create a Custom Metric to report on the number of unique signups from people in the US.

![](/assets/overview-metric-builder-for-mixpanel-segmentation_3.ec7be9f6b48f9e1d25ba6ef1d425f1a91ea0e33fb97c220a6a97c40ce49dc762.4783b0ec.png)

1. Navigate to**Metrics > Custom Metrics**
2. Click the **green + New Custom Metric**button
3. Select the appropriate Mixpanel Data Source
4. By default, the **Segmentation** radio button is selected
5. In order to accurately explain what this Custom Metric is reporting on, we'll name the Custom Metric "Unique US Signups"
6. We want to track signups, so we'll select **Signed up** as the **Event**
7. Totally up all signups, we'll choose **Count** as the **Metric Operation**
8. In the **Filter**, we'll set **Country Code equals US**. This ensures that we will only retain signups from people in the US
9. Next, we'll select the Date Range options for our Custom Metric. We will choose **Week to Date, Month to Date, Quarter to Date, Year to Date, Last Month,**and **Last Quarter**
10. We'll choose **Previous Period** for the **Compare With** field
11. Select **Day** as the **Unit, so** we can group signups based on the day
12. Since we only want to report on unique signups, we'll select **Unique** as the **Type**
13. Click **Preview data**to generate a Data Preview of the Custom Metric
14. Once we confirm that these are the results we're looking for, we'll click **Save** to save the Custom Metric


## How to add a Custom Mixpanel Metric to a Databoard

![](/assets/overview-metric-builder-for-mixpanel-segmentation_4.13cf66c2bd8c5fabc847e2778c7539fbc426bd8923a4e773d135e577ab0014b3.4783b0ec.gif)

1. Open the selected Databoard in the Databox Designer, or create a new Databoard.
2. Drag and drop a blank Datablock onto the Databoard from the Visualization Library.
3. Select the appropriate Mixpanel Data Source in the right-hand Datablock Settings. This must be the same Mixpanel Account that was selected when creating the Custom Metric.
4. Select the  **Custom** tab at the top of the  **Metric** drop-down list.
5. Select the Custom Metric name to populate the Datablock.


## Additional Information

- To report on Custom Events, select **Custom Event** as the **Event.** This will expose the **Custom Event ID** field. Here, you can directly enter the Custom Event ID.