Expand my Community achievements bar.

DTM add s.clearVars() to rules

Avatar

Level 9

5/25/17

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 Comments

Avatar

Employee Advisor

5/30/17

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.

Avatar

Community Advisor

6/15/18

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();

});