Create an Analytics Metric

  1. Working in the Analytics > Search editor, set the search criteria to select the appropriate data.
  2. Click Actions > Create Metric in the search action toolbar.
  3. In the pop-up window, give your metric a name and a description. The name determines how the metric appears in the Metrics panel and the Metric Browser. Keep in mind:
    • Metrics are truncated to whole values. So values less than one are truncated to zero. To work around this, you can multiply a numeric_field_name by a factor of 10, 100, 1000, and so on, depending on the level of decimal accuracy you need. We recommend that you add this factor into the metric display name so other users can understand what the metric represents, for example, Display Name = Metric (Factor 1000). In cases where the value is a percentage, and you convert by multiplying by 100, you probably don't need to put the factor in the metric name because it would be implicit (Metric %).
    • Math operations are only supported inside the aggregation function. For example, count(numeric_field_name * 10) from transactions.
Metric Timestamps

Timestamp metrics always aggregate events from the current minute because metrics are created for events published in the last minute.

If you have specified a value for the eventTimestamp field, the timestamp value in the new metric uses an aggregation of events from the pickupTimestamp field.

For example, you set an eventTimestamp for an event on a previous day. You then create a metric for the event today. The metric does not use your explicit eventTimestamp because it is no longer from the current minute. The metric aggregates events using pickupTimestamp. This ensures that the metric timestamp is based on the current minute because pickupTimestamp cannot be explicitly changed.

See Analytics Events API.