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 (for more information, see 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.
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)
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.
An integer value that is used to track the revenue metric for your experiments, aggregated across all conversion events. Note that:
A floating point value that is used to track a custom value for your experiments. Use this to pass the value for numeric metrics.
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.
Updated about 1 month ago