HomeGuidesAPI Reference
Submit Documentation FeedbackJoin Developer CommunityLog In

Tag events

This topic describes what event tags are and how to implement them in Optimizely Full Stack.

Use cases

Event tags are contextual metadata about conversion events. You can use event tags to:

  • Enrich your exported Optimizely experiment data, for example, so that you can reconcile Optimizely data with data from other company systems. For example, for a product purchase event, you may want to attach additional metadata tags such as a product SKU, product category, order ID, and purchase amount.
  • Track numeric metrics on the Results page Reserved Tag Keys).

Event tags do not affect audiences, and with the exception of reserved tags, do not affect the Results page. They do not need to be registered in the Optimizely app.

Implement tags

You can include event tags as an optional key-value argument when you call the Track Event method. Event tags are distinct from user attributes, which should be reserved for user-level targeting and segmentation. Event tags can be strings, integers, floating-point numbers, or Boolean values.

See the following example:

user = optimizely.createUserContext(userId: "test-user", attributes: ["is_logged_in" : "true"])

var eventTags = Dictionary<String, Any>()
eventTags["category"] = "shoes"
eventTags["revenue"] = 6432  // reserved "revenue" tag
eventTags["value"] = 4 // reserved "value" tag

// Track event with  event tags
try? user.trackEvent("my_conversion", eventTags:eventTags)

Reserved tag keys

The following table lists the reserved tag keys, which are included in their corresponding fields in the Optimizely event API payload. They're bundled into event tags for your convenience. Use them if you want to benefit from seeing specific reporting features, such as revenue metrics or numeric metrics, on your Results page.

Tag key



An integer value that is used to track the revenue metric for your experiments, aggregated across all conversion events. Note that:

  • Revenue is recorded in cents; to record a revenue value of $64.32, use 6432.
  • Add any event you want to track revenue for as a metric in your experiment.
    *Use the overall revenue metric to aggregate multiple metrics tracking separate revenue events. The overall revenue event won't track any revenue unless other metrics in your experiment are tracking an increase or decrease in total revenue; it won't work on its own.


A floating point value that is used to track a custom value for your experiments. Use this to pass the value for numeric metrics.

  • Note: We do not recommend using total value metrics to track monetary values.

Unlike revenue metrics, which use fixed-point numbers, numeric metrics use floating-point numbers. For example, $72.81 would be submitted as 7281 with revenue, but as 72.81 with value. Due to the dynamic precision of floating-point numbers, aggregations for numeric metrics are susceptible to rounding. When tracking monetary values, we recommend using the revenue tag to prevent these rounding errors.

Did this page help you?