DTM add s.clearVars() to rules | Community
Skip to main content
MichaelWon
Level 5
May 26, 2017
New

DTM add s.clearVars() to rules

  • May 26, 2017
  • 2 replies
  • 6714 views
It would be great to add an s.clearVars(); option to each rule. We are moving toward a single page app framework with multiple events firing on a page. It would be nice to have the option to either globally or locally set s.clearVars to rules. As of now we are manually adding it at the top of custom code in each rule where it is required.

2 replies

EricMatisoff
Adobe Employee
Adobe Employee
May 30, 2017

Hi there - My recommendation is to include s.clearVars() in the callback function (s.registerPostTrackCallback). Some details on using it are here: https://marketing.adobe.com/resources/help/en_US/sc/appmeasurement/release/c_release_notes_mjs.html

 

I do believe this functionality will be a built-in feature coming soon to Adobe Launch.

Stewart_Schilling
Community Advisor
Community Advisor
June 15, 2018

I've used that on SPA's and it works like a charm.

Just drop this into your AA Tool custom code (outside of doPlugins)

/****************** Clear vars after each beacon  *******************/

s.registerPostTrackCallback(function(){

  _satellite.notify("s.registerPostTrackCallback - calling s.clearVars()");

  s.clearVars();

});