Last active
March 18, 2019 18:37
-
-
Save shawncreed/152cfa739f1ba0f2a6ee32d1f804895d to your computer and use it in GitHub Desktop.
Revisions
-
shawncreed revised this gist
Mar 18, 2019 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -18,6 +18,8 @@ <h1>Set cookie example</h1> * a pixel to set the cookie on the other domain */ var img = document.createElement('img'); img.height = 1; img.width = 1; img.src = 'https://www.mybank.com/setcookie.php?userid=' + digitalData.user.userid; </script> </body> -
shawncreed created this gist
Mar 18, 2019 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ <html> <head> <title>Set cookie example</title> </head> <body> <h1>Set cookie example</h1> This is a page on the site where the cookie is already available. <script language="javascript"> /* This is where our data layer is being set */ digitalData = { user: { userid: 'a3cceba83235dc95f750108d22c14731' } }; </script> <script language="javascript"> /* This is where we can pull the value from the data layer to populate * a pixel to set the cookie on the other domain */ var img = document.createElement('img'); img.src = 'https://www.mybank.com/setcookie.php?userid=' + digitalData.user.userid; </script> </body> </html>