clearVars
Some implementations, such as on single-page applications, require multiple hits sent on the same page load. Use the clearVars()
method to clear variable values so they don’t persist to subsequent hits.
This method does not take any arguments, and does not return any value. Its only purpose is to clear variable values from the instance object. This method sets the following elements to undefined
:
prop1
-prop75
eVar
-eVar250
hier1
-hier5
list1
-list3
events
products
channel
purchaseID
transactionID
state
zip
campaign
Clear variables using the Web SDK
When you send data to Adobe using the Web SDK, all XDM data is cleared automatically.
Clear Variables using the Adobe Analytics extension
Set the Clear Variables action when configuring a rule.
- Log in to Adobe Experience Platform Data Collection using your AdobeID credentials.
- Click the desired tag property.
- Go to the Rules tab, then click the desired rule (or create a rule).
- Under Actions, click the ‘+’ icon
- Set the Extension drop-down list to Adobe Analytics, and the Action Type to Clear Variables.
s.clearVars() in AppMeasurement and the Analytics extension custom code editor
You can call the s.clearVars()
method anywhere in your implementation after you instantiate the Analytics object instance.
s.clearVars();
recommendation-more-help
b4f6d761-4a8b-4322-b801-c85b9e3be690