{"id":4839,"date":"2022-05-06T14:47:07","date_gmt":"2022-05-06T14:47:07","guid":{"rendered":"https:\/\/www.leadshook.com\/help\/?p=4839"},"modified":"2024-02-14T11:39:56","modified_gmt":"2024-02-14T11:39:56","slug":"__trashed-2","status":"publish","type":"post","link":"https:\/\/www.leadshook.com\/help\/__trashed-2\/","title":{"rendered":"How to Pass Data Using setCookie &#038; grabCookie Functions"},"content":{"rendered":"\n<p class=\"has-vivid-red-color has-text-color\"><strong>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.<\/strong><\/p>\n\n\n\n<p>In this article, you\u2019ll learn how to pass any data through a cookie.<\/p>\n\n\n\n<p><strong>Step 1:<\/strong> 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:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>&lt;script&gt;\n  DT.setCookie('gender','{gender}');\n&lt;\/script&gt;<\/strong><\/code><\/pre>\n\n\n\n<p>Refer to the image below to know more about the <em>setCookie<\/em> function:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1176\" height=\"116\" src=\"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2022\/05\/image.png\" alt=\"\" class=\"wp-image-4840\"\/><\/figure>\n\n\n\n<p><strong>Step 2:<\/strong> Once you have added a <em>setCookie<\/em> script, <a href=\"https:\/\/www.leadshook.com\/help\/how-to-add-a-custom-field\/\">create a new custom field<\/a> that you will use to store the data from the cookie you are going to grab. <\/p>\n\n\n\n<p><strong>Step 3:<\/strong> Add a <em>grabCookie<\/em> script in the final Decision Tree or node where you want to print or call the set cookie.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>&lt;script&gt;\n  DT.grabCookie('gender_grab','gender');\n&lt;\/script&gt;<\/strong><\/code><\/pre>\n\n\n\n<p>Refer to the image below to know more about the <em>grabCookie<\/em> function:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1155\" height=\"116\" src=\"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2022\/05\/image-1.png\" alt=\"\" class=\"wp-image-4841\"\/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Watch the short video below to see how you can test your Decision Tree on your end.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-vimeo wp-block-embed-vimeo wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe title=\"How to Pass a Data Using setCookie &amp;amp; grabCookie Functions\" src=\"https:\/\/player.vimeo.com\/video\/706973228?h=5ba7134381&amp;dnt=1&amp;app_id=122963\" width=\"980\" height=\"551\" frameborder=\"0\" allow=\"autoplay; fullscreen; picture-in-picture\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>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\u2019ll learn how to pass any data through a cookie. Step 1: Add a script in the node where [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,620],"tags":[],"class_list":["post-4839","post","type-post","status-publish","format-standard","hentry","category-leadshook","category-scripts"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Pass Data Using setCookie &amp; grabCookie Functions - LeadsHook Knowledge Base<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.leadshook.com\/help\/__trashed-2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Pass Data Using setCookie &amp; grabCookie Functions - LeadsHook Knowledge Base\" \/>\n<meta property=\"og:description\" content=\"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\u2019ll learn how to pass any data through a cookie. Step 1: Add a script in the node where [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.leadshook.com\/help\/__trashed-2\/\" \/>\n<meta property=\"og:site_name\" content=\"LeadsHook Knowledge Base\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/leadshook\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-05-06T14:47:07+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-02-14T11:39:56+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2022\/05\/image.png\" \/>\n<meta name=\"author\" content=\"Nik T\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@leadshook\" \/>\n<meta name=\"twitter:site\" content=\"@leadshook\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Nik T\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/__trashed-2\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/__trashed-2\\\/\"},\"author\":{\"name\":\"Nik T\",\"@id\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/#\\\/schema\\\/person\\\/4bfe37d814563cc729828b7055313f4d\"},\"headline\":\"How to Pass Data Using setCookie &#038; grabCookie Functions\",\"datePublished\":\"2022-05-06T14:47:07+00:00\",\"dateModified\":\"2024-02-14T11:39:56+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/__trashed-2\\\/\"},\"wordCount\":177,\"publisher\":{\"@id\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/__trashed-2\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/wp-content\\\/uploads\\\/2022\\\/05\\\/image.png\",\"articleSection\":[\"LeadsHook\",\"Scripts\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/__trashed-2\\\/\",\"url\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/__trashed-2\\\/\",\"name\":\"How to Pass Data Using setCookie & grabCookie Functions - LeadsHook Knowledge Base\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/__trashed-2\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/__trashed-2\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/wp-content\\\/uploads\\\/2022\\\/05\\\/image.png\",\"datePublished\":\"2022-05-06T14:47:07+00:00\",\"dateModified\":\"2024-02-14T11:39:56+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/__trashed-2\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.leadshook.com\\\/help\\\/__trashed-2\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/__trashed-2\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/wp-content\\\/uploads\\\/2022\\\/05\\\/image.png\",\"contentUrl\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/wp-content\\\/uploads\\\/2022\\\/05\\\/image.png\",\"width\":1176,\"height\":116},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/__trashed-2\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Pass Data Using setCookie &#038; grabCookie Functions\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/#website\",\"url\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/\",\"name\":\"LeadsHook Knowledge Base\",\"description\":\"LeadsHook Training &amp; Technical Help\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/#organization\",\"name\":\"LeadsHook\",\"url\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/wp-content\\\/uploads\\\/2018\\\/12\\\/leadshook-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/wp-content\\\/uploads\\\/2018\\\/12\\\/leadshook-logo.png\",\"width\":350,\"height\":83,\"caption\":\"LeadsHook\"},\"image\":{\"@id\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/leadshook\\\/\",\"https:\\\/\\\/x.com\\\/leadshook\",\"https:\\\/\\\/www.linkedin.com\\\/showcase\\\/leadshook\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/#\\\/schema\\\/person\\\/4bfe37d814563cc729828b7055313f4d\",\"name\":\"Nik T\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/48d53e68db0b1db1cd5c54a750130fb2ee0c663306ff1bd434373f1a368ef7a0?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/48d53e68db0b1db1cd5c54a750130fb2ee0c663306ff1bd434373f1a368ef7a0?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/48d53e68db0b1db1cd5c54a750130fb2ee0c663306ff1bd434373f1a368ef7a0?s=96&d=mm&r=g\",\"caption\":\"Nik T\"},\"sameAs\":[\"http:\\\/\\\/www.LeadsHook.com\"],\"url\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/author\\\/nik\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Pass Data Using setCookie & grabCookie Functions - LeadsHook Knowledge Base","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.leadshook.com\/help\/__trashed-2\/","og_locale":"en_US","og_type":"article","og_title":"How to Pass Data Using setCookie & grabCookie Functions - LeadsHook Knowledge Base","og_description":"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\u2019ll learn how to pass any data through a cookie. Step 1: Add a script in the node where [&hellip;]","og_url":"https:\/\/www.leadshook.com\/help\/__trashed-2\/","og_site_name":"LeadsHook Knowledge Base","article_publisher":"https:\/\/www.facebook.com\/leadshook\/","article_published_time":"2022-05-06T14:47:07+00:00","article_modified_time":"2024-02-14T11:39:56+00:00","og_image":[{"url":"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2022\/05\/image.png","type":"","width":"","height":""}],"author":"Nik T","twitter_card":"summary_large_image","twitter_creator":"@leadshook","twitter_site":"@leadshook","twitter_misc":{"Written by":"Nik T","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.leadshook.com\/help\/__trashed-2\/#article","isPartOf":{"@id":"https:\/\/www.leadshook.com\/help\/__trashed-2\/"},"author":{"name":"Nik T","@id":"https:\/\/www.leadshook.com\/help\/#\/schema\/person\/4bfe37d814563cc729828b7055313f4d"},"headline":"How to Pass Data Using setCookie &#038; grabCookie Functions","datePublished":"2022-05-06T14:47:07+00:00","dateModified":"2024-02-14T11:39:56+00:00","mainEntityOfPage":{"@id":"https:\/\/www.leadshook.com\/help\/__trashed-2\/"},"wordCount":177,"publisher":{"@id":"https:\/\/www.leadshook.com\/help\/#organization"},"image":{"@id":"https:\/\/www.leadshook.com\/help\/__trashed-2\/#primaryimage"},"thumbnailUrl":"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2022\/05\/image.png","articleSection":["LeadsHook","Scripts"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.leadshook.com\/help\/__trashed-2\/","url":"https:\/\/www.leadshook.com\/help\/__trashed-2\/","name":"How to Pass Data Using setCookie & grabCookie Functions - LeadsHook Knowledge Base","isPartOf":{"@id":"https:\/\/www.leadshook.com\/help\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.leadshook.com\/help\/__trashed-2\/#primaryimage"},"image":{"@id":"https:\/\/www.leadshook.com\/help\/__trashed-2\/#primaryimage"},"thumbnailUrl":"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2022\/05\/image.png","datePublished":"2022-05-06T14:47:07+00:00","dateModified":"2024-02-14T11:39:56+00:00","breadcrumb":{"@id":"https:\/\/www.leadshook.com\/help\/__trashed-2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.leadshook.com\/help\/__trashed-2\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.leadshook.com\/help\/__trashed-2\/#primaryimage","url":"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2022\/05\/image.png","contentUrl":"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2022\/05\/image.png","width":1176,"height":116},{"@type":"BreadcrumbList","@id":"https:\/\/www.leadshook.com\/help\/__trashed-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.leadshook.com\/help\/"},{"@type":"ListItem","position":2,"name":"How to Pass Data Using setCookie &#038; grabCookie Functions"}]},{"@type":"WebSite","@id":"https:\/\/www.leadshook.com\/help\/#website","url":"https:\/\/www.leadshook.com\/help\/","name":"LeadsHook Knowledge Base","description":"LeadsHook Training &amp; Technical Help","publisher":{"@id":"https:\/\/www.leadshook.com\/help\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.leadshook.com\/help\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.leadshook.com\/help\/#organization","name":"LeadsHook","url":"https:\/\/www.leadshook.com\/help\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.leadshook.com\/help\/#\/schema\/logo\/image\/","url":"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2018\/12\/leadshook-logo.png","contentUrl":"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2018\/12\/leadshook-logo.png","width":350,"height":83,"caption":"LeadsHook"},"image":{"@id":"https:\/\/www.leadshook.com\/help\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/leadshook\/","https:\/\/x.com\/leadshook","https:\/\/www.linkedin.com\/showcase\/leadshook\/"]},{"@type":"Person","@id":"https:\/\/www.leadshook.com\/help\/#\/schema\/person\/4bfe37d814563cc729828b7055313f4d","name":"Nik T","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/48d53e68db0b1db1cd5c54a750130fb2ee0c663306ff1bd434373f1a368ef7a0?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/48d53e68db0b1db1cd5c54a750130fb2ee0c663306ff1bd434373f1a368ef7a0?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/48d53e68db0b1db1cd5c54a750130fb2ee0c663306ff1bd434373f1a368ef7a0?s=96&d=mm&r=g","caption":"Nik T"},"sameAs":["http:\/\/www.LeadsHook.com"],"url":"https:\/\/www.leadshook.com\/help\/author\/nik\/"}]}},"_links":{"self":[{"href":"https:\/\/www.leadshook.com\/help\/wp-json\/wp\/v2\/posts\/4839","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.leadshook.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.leadshook.com\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.leadshook.com\/help\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.leadshook.com\/help\/wp-json\/wp\/v2\/comments?post=4839"}],"version-history":[{"count":2,"href":"https:\/\/www.leadshook.com\/help\/wp-json\/wp\/v2\/posts\/4839\/revisions"}],"predecessor-version":[{"id":4844,"href":"https:\/\/www.leadshook.com\/help\/wp-json\/wp\/v2\/posts\/4839\/revisions\/4844"}],"wp:attachment":[{"href":"https:\/\/www.leadshook.com\/help\/wp-json\/wp\/v2\/media?parent=4839"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.leadshook.com\/help\/wp-json\/wp\/v2\/categories?post=4839"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.leadshook.com\/help\/wp-json\/wp\/v2\/tags?post=4839"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}