I am playing around with the webSDK, and noticed that it is not clearing the vars after each action.
In this example, I have three events that occurred. First was a page view which includes the custom event1, the second is a "click to call" which is event11 and finally a "chat" event which is event20.
Each of these events are in different rules which are triggered by different data layer pushes. In the last event, chat, only event20 is set in the xdm.variable.content data element. How can I wipe out the others? I don't want them over counting.
Thanks!
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Yeah, the video is built upon the previous one which describes the XDM setup Jim is suggestion.
https://www.youtube.com/watch?v=PdV8c2lmd-0
Cheers
Views
Replies
Total Likes
Hi @Dave_Hamel_2024 ,
The WebSDK is designed to clear XDM data automatically after each sendEvent call, but sometimes you might need to take extra steps to ensure this happens, especially if you're noticing that variables from previous events are sticking around.
You can manually reset variables in your data layer push. For example, when you push the data for a chat event, you can explicitly set the previous event variables to null, This ensures that the previous variables are cleared and only the new event data is sent.
Sample Code:
dataLayer.push({
event: 'chat',
xdm: {
_experience: {
analytics: {
customDimensions: {
props: {
prop10: null // Clear the custom prop if needed
}
},
event1to100: {
event1: { value: null }, // Clear event1
event11: { value: null }, // Clear event11
event20: { value: "1" } // Set event20
}
}
}
} });
Also, you can set up rules to clear variables.
Log in to Adobe Experience Platform Data Collection, navigate to your tag property, and go to the Rules tab. Edit an existing rule or create a new one, and under Actions, add a new action with the Adobe Analytics extension. Set the action type to “Clear Variables.” This helps to reset the variables based on the conditions you set in the rule.
By manually clearing the variables or setting up appropriate rules, you can manage your event data effectively and avoid overcounting.
Ref: https://experienceleague.adobe.com/en/docs/analytics/implementation/vars/functions/clearvars
https://experienceleague.adobe.com/en/docs/analytics/implementation/aep-edge/web-sdk/overview
Hope this helps!
Views
Replies
Total Likes
Thanks this is helpful. I also found a video by Jim Gordon which was helpful:
Yeah, the video is built upon the previous one which describes the XDM setup Jim is suggestion.
https://www.youtube.com/watch?v=PdV8c2lmd-0
Cheers
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies