Events: Track clicks, pageviews, and other visitor actions

  • Updated
  • Optimizely Web Experimentation
  • Optimizely Web Personalization
  • Optimizely Performance Edge
  • Optimizely Feature Experimentation
  • Optimizely Full Stack (Legacy)

Events

Events are the verbs of Optimizely 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.

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 – 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, 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 set up, track, and manage events in a single project (unless your Optimizely Experimentation plan includes cross-project events for Optimizely Web Experimentation 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 begins tracking data when it you set it up. If you add it as a metric to a running experiment, the data for the event is added retroactively; from the date you created the event, or the date you published the experiment, whichever is more recent.

For more information on events:

An important part of good experiment design is choosing the right events to track. For more information on balancing macro conversions, like revenue, with micro conversions to design an effective experiment, see Track macro and micro-conversion events.

Track 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 http://shop.example.com and http://example.com. These are different origins, so you 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.