Events: Track clicks, pageviews, and other visitor actions

  • Updated

Relevant products:

  • Optimizely Web Experimentation
  • Optimizely Performance Edge
  • Optimizely Feature Experimentation

This topic describes how to:
  • Use click, custom, and pageview events to track visitor behaviors on your site.
  • Measure the impact of your experiments and campaigns.


Events are the verbs of Optimizely Experimentation experiments and campaigns that allow you to track actions that a visitor takes, such as clicks, pageviews, form submissions, and purchases.

For example, you might set up a click event that tracks clicks to a Contact Sales button on your homepage or application. Or, you might set up a custom event to track revenue through your checkout flow-based

If you use Optimizely Experimentation to test on a checkout page, you might need to configure your site for PCI compliance.

Events are reusable, so you can quickly add them to any campaign or experiment that you build.

Types of Events

Optimizely Web Experimentation

You can build the following types of events in Optimizely Web Experimentation:

  • Click events capture visitor clicks on elements like buttons or offers. You create click events on a page, and they inherit URL targeting from that page.

  • Custom events capture additional information using custom code. You can use custom events to track behaviors like watching a video, submitting a form, browsing image 6 in a photo carousel and other actions that are not always reflected in clicks.

  • Pageview events are tracked automatically for each page that you set up.

Optimizely Feature Experimentation

In Optimizely Feature Experimentation, you can track any type of user event from your application. First, you create an event tag string in the Optimizely Feature Experimentation application. Then, use the track()method from the Optimizely Feature Experimentation SDK and pass in the key for the event you created. 

Learn how to implement the track() event method in Optimizely Feature Experimentation: 

How events are calculated

Like pages, events are restricted to individual projects. This means that you will set up, track and manage events in a single project (unless your Optimizely Experimentation plan includes cross-project events for Web or cross-project events for Optimizely Feature Experimentation).

After you add an event to a campaign or experiment, it is called a metric. Metrics are displayed on your Results page and help you measure differences in visitor behavior, based on changes you make to your site in a variation in an experiment or personalized experience.

Events are always on. An event will begin tracking data when it is set up. If it is added as a metric to a running experiment, the data for the event is added retroactively: from the date the event was created or the date the experiment was published, whichever is more recent.

Learn more about how to:

An important part of good experiment design is choosing the right events to track. This article discusses how to balance “macro” conversions like revenue with “micro” conversions to design an effective experiment.

Tracking an event across origins in Optimizely Web Experimentation

Sometimes, you may wish to track events across different origins. For example, you might want to have metrics that measure actions on and These are different origins, so you will need to set up cross-origin targeting in your Optimizely Web Experimentation snippet. Otherwise, you will not see any data for cross-origin metrics on your Results page.

Events in Optimizely Web Personalization

Use events in Optimizely Web Personalization to behaviorally target campaigns and deliver personalized experiences.

Events are always on. They constantly gather information on the behaviors that you identified, even if you have not created a campaign or connected events with an existing campaign. This is useful when you use Optimizely Web Personalization.

If you use Optimizely Web Personalization, always-on events help you create audiences based on behavior. For example, you can target visitors who triggered a certain event over a certain time period, such as “People who searched 2+ times in the last 30 days.” You can also target more specific behaviors with tags.