Disclaimer: This website requires Please enable JavaScript in your browser settings for the best experience.

The availability of features may depend on your plan type. Contact your Customer Success Manager if you have any questions.

Dev guideRecipesAPI Reference
Dev guideAPI ReferenceUser GuideLegal TermsGitHubDev CommunityOptimizely AcademySubmit a ticketLog In
Dev guide

Create events

How to create and add an event in Optimizely Feature Experimentation.

Events are used to track the relative success of your experiment. Events track direct user actions, such as clicks, pageviews, form submissions, purchases, and scroll depth. For information on integrating events into your application code with the SDK, see Track events.

Create an event in Optimizely Feature Experimentation using the UI

To create an event that tracks user actions in the Optimizely Feature Experimentation app:

  1. Go to Events and click Create New Event.

    Events > Create New Event
  2. Enter:

    1. An Event Name.
    2. An Event Key (a unique identifier you will reference in your code when you call Track Event) . Event keys are automatically populated based on the Event Name with the following updates:
      • Uppercase characters are converted to lowercase.
      • Non-alphanumeric characters are replaced with underscores.

        📘

        Note

        You can edit the pre-filled Event Key field.

    3. (Optional) a Description.
  3. (Optional) Configure event properties

    👍

    Beta

    Event properties are currently in beta.

    You can select built-in properties or create custom event properties. Event properties let you track and view additional information on the Optimizely Experimentation Results page and use it to disassemble and analyze your events more in-depth. You can have 15 properties total, including built-in and custom properties.
    Default properties
    Select any of the built-in properties to add it to the event.

    Select default properties

    Custom properties
    To create a custom property to add to the event:

    1. Click Add custom property.
    2. Enter a name.
    3. Select the type of custom property from the data type drop-down list.
create custom property
  1. Click Create Event.

Add events to your experiments

To add an event to your experiment in the Optimizely Experimentation application:

  1. Go to Flags and select a flag.

  2. Select the environment and click the rule to which you want to add an event.

  3. Select the event you created earlier in the Metrics field or click Create new event. Click All projects to see events from your Feature Experimentation and Web Experimentation projects.

    Add metric to flag

See Run A/B tests for information on creating an A/B test rule.

Track events in your application code

See the Track Event documentation in your preferred SDK to implement event tracking in your code:

Create metrics

Metrics measure the success of your experiment by telling you whether an experiment is winning, losing, or inconclusive. Metrics are derived from events, which directly track actions like clicks, pageviews, form submissions, purchases, and scroll depth.

Optimizely Feature Experimentation uses a natural-language metrics builder in the UI that lets you define and add metrics to your experiments and campaigns.

See Create a metric in Optimizely using the metric builder for instructions on creating metrics in Feature Experimentation.