Adobe Analytics Plugin On getTimeBetweenEvents
Adobe kindly offers us sophisticated solutions to maximize the use of Adobe Analytics. Adobe Consulting provides many refined plug-ins, one among them is GetTimeBetweenEvents which is the subject of this article because it is the least frequently used plug-in, but if we are aware of its present usage, we can explore all of its potential use cases.
With the help of the getTimeBetweenEvents plugin, you can monitor the interval between any two Analytics events, including custom and shopping cart events. It is helpful for keeping note of the length of time it takes to finish a checkout process or any other process you want to measure time for. If you don't want to track the duration of any conversion procedures, you don't need this plug-in.
There are numerous use cases to use this plugin, but one frequent application is to measure time between user arriving on product detailed page (PDP) and a confirmation page. Here's how you guarantee a high-fidelity signal and a reliable, stable plugin implementation to enable data flow to Adobe Analytics.
function getTimeBetweenEvents(ste,rt,stp,res,cn,etd,fmt,bml,rte)
The time between the start timer event and the stop timer event is represented as an integer in the chosen format when this function is called.
The function uses required and optional parameters.
Required parameters
ste (data type: string): An Analytics event to “start the timer”.
rt (data type is boolean): If you want the timer to restart each time the events variable includes a start timer event, set the value to true. If you don't want the timer to restart when it detects a start timer event, set the value to false. Essentially, used to restart timer.
stp (data type: string): An Analytics event to “stop the timer”.
res (data type: Boolean): Timer reset option. If you wish to reset the timer once it stops and record the time since the timer began, set the value to true. If you wish to record the time but keep the timer running, set false. When the events variable records a stop event, the timer stops if false is set. Essentially, used to reset option.
Optional parameters
cn (data type: string): The name of the cookie where the time of the first event is stored, by default cookie name is "s_tbe".
etd (data type: integer): The expiration time for the cookie in days. Set to 0 to expire at the end of the browser session. Defaults to 1 day when not set
Recommended by LinkedIn
fmt (data type: string): The format of the time that the number of seconds is returned in: “s” for seconds, “m” for minutes, “h” for hours and “d” for days
The following guidelines govern the format of return values when they are not set:
bml (data type: number): The length of the rounding benchmark in the fmt argument's specified format. For instance, the return result is rounded to the nearest 2-second benchmark if the fmt parameter is "s" and this argument is 2. When this parameter is 0.5 and the fmt argument is "m," the return value is rounded to the nearest benchmark time of a half-minute.
rte (data type: string): An Analytics events that remove or delete the timer.
Syntax
If you enjoy using this plugin, keep note of the interval between two regular occurrences to determine when the conversion will take place. This should be the getTimeBetweenEvents plugin's syntax
eVarN = s.getTimeBetweenEvents("scAdd", false, "purchase", true, "", 0, "m", 0.5, "");
Final Results
After the implementation is complete, the data in Adobe Analytics report looks like this:
References:
The article is co-authored by Oshu Kapil
How do we call the function after initialisation? I used the plugin code in adobe analytics extendion custom code and set evar in rule s.tl but it’s not working.