Install the plug-in using the Adobe Analytics extension
Adobe offers an extension that allows you to use most commonly-used plug-ins with Adobe Analytics.
-
Log in to Adobe Experience Platform Data Collection using your AdobeID credentials.
-
Click the desired tag property.
-
Go to the Extensions tab, then click on the Catalog button
-
Install and publish the Common Analytics Plugins extension
-
If you haven’t already, create a rule labeled “Initialize Plug-ins” with the following configuration:
- Condition: None
- Event: Core – Library Loaded (Page Top)
-
Add an action to the above rule with the following configuration:
- Extension: Common Analytics Plugins
- Action Type: Initialize Numbers Suite
-
Save and publish the changes to the rule.
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-ins
The zeroPad function uses the following arguments:
- num (required, integer): The number to pad. The function rounds down the value of this argument if it contains decimals.
- nod (required, integer): The number of digits in the final return value. If the number to pad has less digits than the number of digits to pad to, then the plug-in adds zeroes to the beginning of the
numargument.
The randomNumber function uses the following arguments:
- nod (optional, integer): The number of digits in the random number that you want to generate. The maximum value is 17 digits. The default value is 10 digits.
The twoDecimals function uses the following arguments:
- val (required, number): A number (represented by either a string or number object) that you want to round to the nearest hundredth.
Returns
- The zeroPad function returns a string equal to the
numargument but with a specific number of zeroes added to the beginning of its value, which ensures that the return value has the correct number of digits. - The randomNumber function returns a string equal to a random number with the desired number of digits.
- The twoDecimals function returns a number object rounded to the closest hundredth.
Example Calls
zeroPad examples
randomNumber examples
twoDecimals examples
Version History
1.0 (May 25, 2019)
- Initial release.
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.