Created
July 19, 2018 17:16
-
-
Save MyCueCards/b32f9fd2a563589e9fdead2c27a84f9a to your computer and use it in GitHub Desktop.
In Google Tag Manager, get a variable session storage. This is entered into GTM as "Customer JavaScript" variable. The result is also a variable as a "1st Party Cookie."
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function () | |
{ | |
var result = ''; | |
if(typeof(Storage) !== 'undefined') | |
{ | |
if (typeof(window.sessionStorage._enterCookieName) !== 'undefined') | |
{ | |
result = window.sessionStorage._enterCookieName + ''; | |
} | |
} | |
else | |
{ | |
result = {{enter_1stPartyCookie_VariableType}}; | |
} | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment