simone-coelho / optimizely-time-to-conversion

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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 in localStorage. 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 Start Timer At Event (api name) timestamp and the current time is calculated and this value is dispatched as an event (numeric metric) to Optimizely.

Update: Previously, the module used the Optimizely visitor attributes API to store the data. This resulted in sending large chunks of stringified JSON in every Optimizely event request. The timestamp data has since been moved to separate local storage keys. Caveat: Measuring time-to-conversion across domains will not work out of the box, since the timestamp data is no longer attached to the Optimizely visitor data storage.

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 Configure Metrics
  • Visit the 'Integrations' tab and you will see a Time To Conversion integration module Integrations Screen
  • Check the 'tracked' checkbox in the upper right
    • Start Timer At Event (api name) - api name of the event you want to begin the timer (required)
    • Stop Timer At Event (api name) - api name of the event you want to stop the timer (required)
    • Elapsed Time Metric (api name) - api name of the numeric event you will track the elapsed time to (required)
    • Max Time To Conversion - will ignore elapsed times above the supplied value
    • Min Time To Conversion - will ignore elapsed times below the supplied value
    • Resettable - indicates you want to reset the timer if the user re-converts on Start Timer At Event
    • Resettable After Elapsed Time (sec) - will only reset the timer if a user re-converts on Start Timer At Event after the supplied number of seconds
  • 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").bindTTCTracking 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)
  • 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

License:Apache License 2.0


Languages

Language:JavaScript 100.0%