Search code examples
adobe-analytics

How do I escape the delimiter in an Omniture list var


If I have a list var that looks like this:

title:another title:some title

with my delimiter is set as a colon :.

What happens if I want to send a title like this:

title: now with colons

How do I escape the delimiters in the title? Something like this:

title\: now with colons:another title:some title

Or maybe like this?

title:: now with colons:another title:some title

Is that specified anywhere?


Solution

  • Adobe does not have a way to escape (ignore) the chosen delimiter from being treated as the delimiter. Ideally you should choose a delimiter that will never show up in your values, and also ensure the chosen delimiter gets stripped (or replaced with something else) from your values before using it in the list var.

    Looks like from your post you are popping a list of titles (article? movie?). You might consider setting the list var to use something not commonly found in titles, such as a pipe | or carat ^. And make sure to strip them from your values, just in case.

    Whether or not you choose to remove them or replace them is up to you. There's no real benefit from an analytics perspective, but it may or may not help you better tie the data back to some other system (like your site's database).

    Example:

    someList=['foo','bar','foo:bar','a:b:c'];
    // loop through and replace the chosen delimiter with an underscore
    for (var i=0,l=someList.length;i<l;i++) {
      someList[i]=someList[i].replace(/:/g,'_');
    }
    s.list1 = someList.join(':');