I am using code below to get cookie and assign it to ampscript variable @user
function checkCookie() {
var user = getCookie("email");
if (user != "") {
alert("Checking cookie: " + user);
Variable.SetValue("@user", user);
} else {
}
}
I am calling check cookie function on body on load:
<body onload="checkCookie()">
I am using code below to display different content based on whether cookie is present or not.
%%[IF EMPTY(@user) THEN]%%
%%[ELSE]%%
%%[ENDIF]%%
I am able to set cookie, get cookie and check cookie. Check cookie alert displays correct information. However, the value of cookie is not getting assigned to @user by
Variable.SetValue("@user", user);
Am I missing something?