Targeting based on a custom cookie value
Hi,
Could anyone please give me an advice on how to create a segment in T&T based on cookie value?
What I've tried to do is to add an Expression Target:
return document.cookie.replace(/(?:(?:^|.*;\s*)network\s*\=\s*([^;]*).*$)|^.*$/, "$1").toLowerCase().indexOf("par_") != -1
This searches for "par_" string in the cookie "network".
When I try to add this Expression Target I get the following error:
Expression for rule Channel: Partner is not valid: "Syntax or runtime error: ReferenceError: "document" is not defined."
I've looked at the Expression Target documentation (http://microsite.omniture.com/t2/help/en_US/tnt/pdf/js_expression_cheat_sheet.pdf) but I could not find any way of how to create the Expression Target based on the cookie.
Can anyone help, please? Perhaps there are also easier way creating segments based on the cookie value?
Thanks,
Lucas