I have a use-case connected with counting page-views. That data element should live as long as a particular visitor. I was trying to set this up as Data Element in UI but then I thought that it might be user setting this up as a rule.
Why that custom code in rule does not work? It always returns 0 .....
if(!_satellite.setVar('PageViewCount', 0)) {
_satellite.setVar('PageViewCount', 0);
} else {
let vaar = _satellite.getVar('PageViewCount')
vaar= vaar+ 1
_satellite.setVar('PageViewCount', 0);
console.log(vaar)
}