No results for ""
EXPAND ALL
  • Home
  • API docs

GIVE DOCS FEEDBACK

Experimentation events

Read time: 3 minutes
Last edited: Feb 20, 2024

Overview

This topic explains Experimentation events and how they work.

Understanding Experimentation events

An Experimentation event is any event an SDK produces that impacts your experimentation event count. There are two categories of Experimentation events:

  • Metric events: click, page view, and custom events from metrics used in running experiments.
  • Evaluation events: feature events from flags with targeting rules included in running experiments.

Here are examples of each event:

{
"kind": "click",
"key": "<internal id, not used>",
"url": "https://example.com/",
"creationDate": 16420388151234,
"selector": "button.click-track"
"contextKeys": {
"user": "Sandy",
"anonymousUser": "123213421231"
}
}

Understanding metric events

Server-side, client-side, and mobile LaunchDarkly SDKs send custom metric events when you call the SDK's track method.

Try it in your SDK: Sending custom events

In addition, the JavaScript SDK also sends a click metric event when an end user clicks on a page URL or anchor tag that you have included in a click conversion metric, and sends a page view metric event when an end user visits a URL that you have included in a page view conversion metric.

You can view metric events on the Live events page using the Experiments filter.

If you prefer to import metric events from your existing data pipeline, read Importing metric events.

Understanding evaluation events

Server-side, client-side, and mobile LaunchDarkly SDKs send a feature event when you call the SDK's variation method to evaluate a flag in an experiment. To learn more about the variation method, read Evaluating flags.

The JavaScript SDK and most JavaScript-based SDKs also send a feature event when you call the SDK's allFlags method, unless you configure it not to. The exception to this is the React Web SDK, which does not send an event by default when you call the allFlags method. To learn more about events in the React Web SDK, read Events.

Configuring the JavaScript SDK and JavaScript-based SDKs not to send feature events when you call allFlags limits the number of events these SDKs send to LaunchDarkly. To learn more about how SDKs send events, read Analytics events.

Try it in your SDK: Getting all flags

Correlating variations and conversions

A conversion is when a user action provides a measurable value for a metric. For example, if a metric is tracking clicks on a checkout button, LaunchDarkly registers a conversion each time an end user clicks the button. The SDK sends a track call to register the conversion in LaunchDarkly.

LaunchDarkly uses variation calls to correlate the variation an end user received to a conversion within a 90-day window. If there are more than 90 days between the time of a variation call and a track call on a user key, then LaunchDarkly does not register the metric in the experiment.

In rare cases, unexpected behavior may cause an end user to receive multiple variations in the 90 days prior to a conversion. In these cases, LaunchDarkly attributes the conversion to the first variation the end user received in that 90-day period.