Skip to content

cooperreid-optimizely/optimizely-time-to-conversion

 
 

Repository files navigation

Optimizely Time To Conversion

Optimizely Analytics Extension that allows you to measure the "Time To Conversion" for a given metric within your experiment

This works by persisting a list of timeable events & bucketing timestamps by means of the (user api). Within Project JavaScript, there is an event tracking listener (docs) that checks to see if the fired event lives in the list of timeable events. If so, the elapsed time (in seconds) between the bucketing decision and the current time is calculated and this value is dispatched as an event (numeric metric) to Optimizely.

Results Screen

How to install

How to use

  • Create a Numeric Metric (Optimizely docs) and take note of its api name
  • Navigate to the experiment to which you'd like to track the conversion
  • Visit the 'Metrics' tab and add the Numeric Metric you created in the first step
    • Configure the metric to the following settings Decrease in total value per conversion
  • Visit the 'Integrations' tab and you will see a Time To Conversion integration module Integrations Screen
  • Check the 'tracked' checkbox in the upper right
    • Set the Listen for Event (api name) field to the api name of the event you want to time
    • Set the Time To Conversion Event (api name) field to the api name of the numeric metric you created above
    • Select the appropriate Reset timer on re-bucket setting. If you want to reset the timer on each re-bucket in the experiment, choose 'yes' otherwise choose 'no'.
  • Save your changes, Publish the experiment

Debugging

Use the following method to log the data persisted to the visitor profile via the extension

window.optimizely.get("custom/ttc").debug();

Enable logging to debug the following as they occur:

localStorage.setItem('logttc', 1);
  • Timeable events that are registered into the visitors profile (via the window.optimizely.get("custom/ttc").listenTrack call within the extension
  • Dispatched tracking calls to Optimizely that include the numeric metric 'time to conversion'

Future enhancements

  • Multiple metric support (currently you can only configure to time a single metric)
  • Max time-to-conversion to minimize outliers (extension setting)
  • Conversions in the same session only (extension setting)

About

Optimizely Analytics Extension that allows you to measure the "Time To Conversion" for a given metric within your experiment

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%