Install the plug-in using custom code editor
If you do not want to use the Common Analytics Plugins plug-in extension, you can use the custom code editor.
- Log in to Adobe Experience Platform Data Collection using your AdobeID credentials.
- Click on the desired property.
- Go to the Extensions tab, then click the Configure button under the Adobe Analytics extension.
- Expand the Configure tracking using custom code accordion, which reveals the Open Editor button.
- Open the custom code editor and paste the plug-in code provided below into the edit window.
- Save and publish the changes to the Analytics extension.
Install the plug-in using AppMeasurement
Copy and paste the following code anywhere in the AppMeasurement file after the Analytics tracking object is instantiated (using s_gi). Preserving comments and version numbers of the code in your implementation helps Adobe with troubleshooting any potential issues.
Use the plug-in
The getTimeToComplete function uses the following arguments:
sos(optional, string): Set to"start"when you want to start the timer. Set to"stop"when you want to stop the timer. Defaults to"start".cn(optional, string): The name of the cookie to store the start time. Defaults to"s_gttc".exp(optional, integer): The number of seconds, hours or days (depending on thetptime-parting argument) that the cookie (and timer) expires. Defaults to 30 minutes.tp(optional, string): The time-parting string that the cookie (and timer) expires, used with theexpargument. Set to “d” for days, “h” for hours, or “s” for seconds. If this is not set, the cookie (and timer) expiry defaults to 30 minutes, regardless of what theexpargument has been set to.
Calling this function returns a string that contains the number of days, hours, minutes and/or seconds it took between the "start" and "stop" action.
Examples
Version History
4.0 (March 19, 2021)
- Added version number as context data.
3.1 (September 30, 2019)
- Added logic that requires a value of either “start” or “stop” in the first argument. All other values passed in stop the plug-in from running.
- Updated
inList 2.0plug-in toinList 2.1.
3.0 (August 23, 2018)
- Updated the
formatTime v1.0plug-in toformatTime v1.1.
3.0 (April 17, 2018)
- Point release (recompiled, smaller code size).
- Minor bug fixes.
2.0 June 21, 2016)
- Eliminated the dependency on the
p_foplug-in. - Added compatibility with H-code and AppMeasurement.
- Added console logging.
More help on this topic
Was this content helpful?
Announcements
Get hands-on with agentic AI.
Explore how AI agents work together through real examples and hands-on practice. Join your local User Group to design an agent workflow with your peers and leave with a practical framework you can apply to your own work.
Find an eventAdobe CX Analytics Portfolio Roadmap Webinar - Americas & EMEA
Preview the CX Analytics roadmap across CJA, Adobe Analytics, and more. Ask the team.
Adobe CX Analytics Portfolio Roadmap Webinar - Americas & APAC
Preview the CX Analytics roadmap across CJA, Adobe Analytics, and more. Ask the team.