Skip to main content


Optimizely Knowledge Base

Total value and other numeric metrics

  • Add the required code to your site to allow total value metrics to work
  • Understand the difference between value metrics and revenue metrics

Optimizely's total value metric is a very flexible numeric metric, allowing you to track actions that go beyond conversions and revenue. As long as it's quantifiable, you can use total value to track it.

Check out our Knowledge Base article on suggested use cases for Optimizely's total value metric.

Add the tracking call

When using total value as your numerator, you will have to add some Javascript to your experiment or campaign. Once you are ready to add code, use the reserved value tag.

  • If you are using Optimizely Web, add a small snippet of code to your site to call Optimizely's event tracking API. Place this code on the pages where the event occurs.

       window["optimizely"] = window["optimizely"] || [];
         "type": "event",
         "eventName": "Videos Watched",  //this refers to the API name of the event
         "tags": {
           "value": 4                   
  • If you are using Optimizely Full Stack, include the value tag when tracking an Optimizely event. Here's an example of what that might look like if you were using our JavaScript SDK.

    var eventKey =  "Videos Watched";     
    var userId =    "";
    var attributes = {
      DEVICE:       "iPhone"
    var eventTags = {
      category:     "videos",
      value:        4                     
    // Include revenue among other event tags when submitting Events
    optimizely.track(eventKey, userId, attributes, eventTags);

Value metrics vs revenue metrics 

We don't 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 metric to prevent these rounding errors.