Adobe DTM Custom rule conditions check for cookies -


i have problems specific rule fire in dtm. , documentation on custom rule conditions adobe basic. should do:

  • check if specific cookie exists (values of cookie irrelevant).
  • when cookies not exist fire rule.

with script should work:

    var n = document.cookie,      = "somecookie" + "=",      o = n.indexof("; " + i);      if (-1 == o) {      if (o = n.indexof(i), 0 != o) return null      } else {      o += 2;      var r = document.cookie.indexof(";", o); - 1 == r && (r = n.length)      }      return unescape(n.substring(o + i.length, r))  

but exact opposite. when cookie exists, rule fired.

if want stick using data > custom condition, must either return (bool) true if want condition pass, or (bool) false if want condition fail.

simple example:

only trigger rule if js var foo equals "bar":

if ((typeof foo!='undefined')&&(foo=='bar'))   return true; return false; 

Comments

Popular posts from this blog

How to connect android app to App engine -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

php - display validation error message next to the textbox in codeigniter -