Expand my Community achievements bar.

Join us for the next Community Q&A Coffee Break on Tuesday April 23, 2024 with Eric Matisoff, Principal Evangelist, Analytics & Data Science, who will join us to discuss all the big news and announcements from Summit 2024!
SOLVED

Time between Values being set in a variable

Avatar

Level 1

How can I track how much time (in seconds) elapses between two events? I would like to look at the time between two different values being set in a variable (separate server call).  We are looking to do something similar to the TimeToComplete Plug-in described here:

https://blogs.adobe.com/digitalmarketing/analytics/plug-ins-inside-omniture-sitecatalyst/

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Your best bet here is going to be using a cookie. Set a cookie with the timestamp when the first event is set, then when the second event fires, call the cookie and set a variable value based on the elapsed time.

  • If you plan to use this as a dimension, you can either use the value in seconds, or use additional logic to put them in buckets.
  • If you plan to use this as a metric, you can increment an event by the number of seconds that have elapsed. Recent appMeasurement libraries allow the format s.events="event1=10".

View solution in original post

1 Reply

Avatar

Correct answer by
Employee Advisor

Your best bet here is going to be using a cookie. Set a cookie with the timestamp when the first event is set, then when the second event fires, call the cookie and set a variable value based on the elapsed time.

  • If you plan to use this as a dimension, you can either use the value in seconds, or use additional logic to put them in buckets.
  • If you plan to use this as a metric, you can increment an event by the number of seconds that have elapsed. Recent appMeasurement libraries allow the format s.events="event1=10".