This guide is provided without our free support because setups vary from business to business. This guide is for a technical audience. Please contact us if you need our technical and development services.

In this article, you’ll learn how to pass any data through a cookie.

Step 1: Add a script in the node where you want to pass the data from the custom field to the cookie. See the sample script below:

<script>
  DT.setCookie('gender','{gender}');
</script>

Refer to the image below to know more about the setCookie function:

Step 2: Once you have added a setCookie script, create a new custom field that you will use to store the data from the cookie you are going to grab.

Step 3: Add a grabCookie script in the final Decision Tree or node where you want to print or call the set cookie.

<script>
  DT.grabCookie('gender_grab','gender');
</script>

Refer to the image below to know more about the grabCookie function:

Watch the short video below to see how you can test your Decision Tree on your end.