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.
- Install the
Project JavaScript
code found in projectjs.js - Create an Analytics Extension from JSON (Optimizely docs)
- Copy the JSON contents from analytics-integration-config.json
- Enable the extension you created (Optimizely docs)
- 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
- Configure the metric to the following settings
- Visit the 'Integrations' tab and you will see a Time To Conversion integration module
- 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'.
- Set the
- Save your changes, Publish the experiment
window.optimizely.get("custom/ttc").debug();
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'
- 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)