Custom metrics

Leanplum gives you the ability to easily create custom metrics based on the default, out-of-the-box metrics. Custom metrics, like the default metrics, will appear as tiles in the Analytics Dashboard and can be filtered, grouped and cohorted.

Create a custom metric

To start creating a custom metric, scroll to the bottom of the Analytics Dashboard.

  1. Click on the + metric tile.
  2. Select Custom metrics from the left pane of the pop-up window.
  3. Click the + Create new metric button. This will open the New Metric setup window.
  4. Give your Custom Metric a Name. Try to be clear and descriptive.
  5. Under Based on metric, click Choose a metric.... Find your metric in the Choose a metric window and click on it to add it.
  6. Under Second metric, follow the same steps above to choose a metric.
  7. Under Operation, select an operator (division, multiplication, etc.) to operate on the two metrics.
  8. (Optional) Under Scaled by, you can enter a number (usually 100) that will adjust the result of the custom metric. Most typically, this is used to convert a decimal to a percentage (by scaling the two divided metrics by 100).
  9. (Optional) Under Units, add the units for this metric.
  10. For I'd like this metric to choose either increase or decrease depending on your goal for this custom metric. This will affect how changes are displayed in the Analytics Dashboard.
  11. Click Finish.

Example

Let's create a Custom Metric for Conversion rate based on two custom events: Add to Cart and Checkout.

  • Name the custom metic "Conversion rate".
  • Set the based on metric to Event > Checkout > Total occurrences.
  • Set the second metric to Event > Add to Cart > Total occurrences.
  • Choose / for the operation.
  • Scale by 100.
  • Units are %.
  • We'd like this metric to increase.

Note: The Based on metric will serve as one of two metrics in a calculation, specifically the numerator if division is selected as the operator.

Metrics based on a numeric parameter

For events and states, Leanplum lets you create custom metrics from event or state parameters. To create a custom metric based on a numeric parameter:

  1. Click on the + metric tile at the bottom of the Analytics Dashboard.
  2. Select any event from the pop-up window, and check whether the parameter you would like to use is listed under the Parameters section.
  3. If the parameter is not listed, click on Edit, click the checkbox next to the parameter you would like to use, then click Save.
  4. Select the parameter in pop-up window. You should see the follow metrics to choose from:
    • Total sum of
    • Average per occurrence
    • Total per session
    • Total per daily user
  5. Choose the metric you'd like to add.
  6. Click Finish

Edit a custom metric

You can edit any of the custom metrics in your app.

  1. In the Analytics Dashboard, click on the + metric tile at the bottom.
  2. Select Custom metrics in the left pane of the pop-up window.
  3. Find the custom metric you'd like to edit.
  4. Click the pen icon for that metric.
  5. Make changes to the metric following the guidelines above for new custom metrics.
  6. Once you're done making changes, click Finish to save them.

Delete a custom metric

  1. In the Analytics Dashboard, click on the + metric tile at the bottom.
  2. Select Custom metrics in the left pane of the pop-up window.
  3. Find the custom metric you'd like to edit.
  4. Click the trash icon to delete that metric.

Was this article helpful?
Have more questions? Submit a request