There is a TON of javascript information out there, but I can't seem to put it all together. Through Google Tag Manager I've created a script to create a Cookie. I then used a 1st party variable to capture that value. This looks to be working. In the developer toolbox, in cookies, I can see the cookie with the name "LandingPage" and value of "/XYZ/". There are several other cookie values as well, but I'm focused on this particular one. What I can't figure out is how to read/display that particular "LandingPage" value.
For simplicity of learning, I was just trying to create a function, like an alert, to display the value of "LandingPage", which is "/XYZ/". I just haven't been able to get the LandingPage value to display.
Below is the code I'm using to set/create the cookie.
<script>
function createCookie(name,value,days) {
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else var expires = "";
document.cookie = name+"="+value+expires+"; path=/";
}
createCookie("LandingPage","{{Page Path}}")
</script>