What are possible reasons why ClearVariable fails? | Community
Skip to main content
Level 6
February 21, 2019
Solved

What are possible reasons why ClearVariable fails?

  • February 21, 2019
  • 34 replies
  • 31629 views

We are currently mainly using direct call rules for our tracking. Even the page view itself is a direct call rule, as we had the pageBottom fire when it shouldn't (SPA not finished initializing). All our rules follow the same pattern in the action section: 1-n Set Variables, Send Beacon, Clear Variables.

One of these Set Variables actions is responsible to set s.products and s.events only on product detail pages, to track its view (prodView and a custom event). I now have the strange behaviour that these are not cleared at the end: The product detail page has multiple tabs which we only track minimalistic with the title of the tab, a custom event for tab click and some standard variables which are tracked in a doPlugin method. But the first tab I click also contains s.products and s.events values from the page view rule fired before. The second and any other on page rule are fine and do not contain them, as if the Clear Variables from the tab click rule worked and the one from the page view didn't. Is there any way to debug the Clear Variable action to see if it really isn't executed?

I debugged the tab click rule and there s.products is still populated the first time the rule gets fired.

EDIT: Could there be some issues, if this tab click rule wasn't modified for a while, but we now use a newer version of the Analytics Extension? Do you have to "touch" every single rule if you update one of the extensions that are used within the rule?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by josnyder1

I've seen problems with the ManageVars plugin where it overwrites the s.t function.  It looks like you are having this problem.  Check your doPlugin custom code to see if this is the case.

34 replies

thebenrobb
Adobe Employee
Adobe Employee
October 10, 2019

I've asked the Analytics team to take a look.

Adobe Employee
October 10, 2019

I have not been able to reproduce the clearVars issue you reported.  Could you give me some more information such as a link to a page where you see the problem or a link to the Launch package?

josnyder1Adobe EmployeeAccepted solution
Adobe Employee
October 22, 2019

I've seen problems with the ManageVars plugin where it overwrites the s.t function.  It looks like you are having this problem.  Check your doPlugin custom code to see if this is the case.

FaresAldik
October 22, 2019

Hi josnyder​ ! You've found my issue. It's was the manageVars plugin. It was present in the older code and the clearVars function was being overwritten by the plugin. I've completely removed the plugins (manageVars and clearVars). And now we're good to go!

Thank you for sharing this tip. I was pulling my hair on this.