Set up metrics

Metrics measure the actions you want to optimize in your content or Experiences through track events. They are available to customers of Contentful Analytics and Contentful Personalization. You can set up your metrics from the “Optimization” tab of the organization settings. 

Important: Only organization admins or developer roles have access to the “Optimization” tab in the organization settings. 

NOTE: We recommend sending relevant track events before creating metrics based on them. This ensures that the metrics reference valid events and allows you to select them from an auto-completion menu, reducing setup errors.

To create a metric:

  1. Log in to the Contentful web app.

  2. Click the environment switcher, and select Organization settings & subscription.

  3. Navigate to the “Optimization” tab. 

    Ctfl Personalization: The Optimization tab

    NOTE: The Main data bucket tab is displayed by default. If you want to add metrics to the Development data bucket, select the "Development" tab.

  4. Under "Metrics", click +Add metric.

    Ctfl Personalization: Add metric button


    The “Add a metric” modal is displayed.

    Ctfl Personalization: Add a metric modal
  5. Under “Basics’, enter a relevant name for your metric.

  6. Optional: Enter a suggestive description for your metric to help identify its purpose later.

  7. Under “Tracking setup”, set the Metric type field value to how you want the metric to be calculated: Binary, Count, Currency, Time or Other. For more information about metrics, see the Metrics page.

    Ctfl Personalization: Tracking setup section
  8. Under Tracked event name, enter the name of the track events sent to Contentful. For more information, see the Event name section on the Metrics page.

    NOTE: We recommend sending relevant track events before creating metrics based on them. This ensures that the metrics reference valid events and allows you to select them from an auto-completion menu, reducing setup errors.

  9. For Currency, Time and Other value metric types, you must specify the Event property that holds the relevant value.

    Ctfl Personalization: Event property field

    NOTE: As with the event name, we recommend sending events before creating metrics. If you want to analyze multiple properties of the same event, simply create multiple metrics.

  10. Under “Attribution window”, enter the amount of time for how long a conversion is attributed to the original event. For more information about the attribution window, see the Attribution window section on the Metrics page.

    NOTE: Set the attribution window based on how long you expect the (personalized) content to influence a user.

  11. Click Save. Your metric is created and displayed in the dashboard.

The dashboard provides an overview of all configured metrics. By default, Contentful tracks the performance of all metrics across all of your content and Experiences. To confirm that a metric is set up correctly, a column displays how many times the defined metric was triggered by a track event in the past 30 days.

Important: After a metric is created, you cannot edit most configuration options, except the name and description. We do this to ensure data consistency. If you need to track a metric differently, create a new one and/or delete the existing metric.