DTM add s.clearVars() to rules

MichaelWon

MVP

25-05-2017

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 (2 New)
2 Comments

ericmatisoff

Employee

30-05-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.

StewSchilling

MVP

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

});