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 manageVars function uses the following arguments:
-
cb(required, string): The name of a callback function that the plug-in uses to manipulate the Analytics variables. You can use an Adobe function likecleanStror your own custom function. -
l(optional, string): A comma-delimited list of Analytics variables that you want to manipulate. Defaults to ALL Adobe Analytics variables when not set, which includes:pageNamepurchaseIDchannelserverpageTypecampaignstatezipeventsproductstransactionID- All props
- All eVars
- All hierarchy variables
- All list variables
- All context data variables
-
Il(optional, boolean): Set tofalseif you want to exclude the list of variables declared in thelargument instead of including them. Defaults totrue.
Calling this function returns nothing. Instead it changes the values of Analytics variables based on the desired callback function.
Example Calls
Example #1
The following code…
…changes the values of all the variables described above to lowercased versions. The sole exception to this is the events variable, as some of the events (e.g. scAdd, scCheckout, etc.) are case-sensitive and should not be lowercased
Example #2
The following code…
…essentially produces the exact same result as the first example since the events variable isn’t lowercased by default.
Example #3
The following code…
…will change (e.g. lowercase) only the values of eVar1, eVar2, eVar3, and list2
Example #4
The following code…
…will change (e.g. lowercase) the values of all the variables described above EXCEPT for eVar1, eVar2, eVar3, and list2
Example #5
The following code…
…changes the values of all the variables described above, including the events variables. Specifically, the cleanStr callback function does the following to each variables’ value:
- Removes HTML encoding
- Removes whitespaces found at the beginning and end of the value
- Replaces left/right single quotes with a straight single quote (
') - Replaces tab characters, newline characters, and carriage return characters with spaces
- Replaces all double (or triple, etc.) spaces with single spaces
Version History
3.0 (March 19, 2021)
- Added version number as context data.
2.1 (January 14, 2019)
- Bug fix for Internet Explorer 11 browsers.
- Changes for
s.cleanStr, which now uses the regularcleanStrfunction.
2.0 (May 7, 2018)
- Point release (including complete reanalysis/rewrite of plug-in)
- Added
cleanStrcallback function
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.