Created
February 14, 2019 13:55
-
-
Save eyalway2cu/043807a66f5e55c1fa4be7496b64978b to your computer and use it in GitHub Desktop.
Get cid from cookie and save to cid variable
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 characters
| <script> | |
| function getCookie(name) { | |
| function escape(s) { return s.replace(/([.*+?\^${}()|\[\]\/\\])/g, '\\$1'); }; | |
| var match = document.cookie.match(RegExp('(?:^|;\\s*)' + escape(name) + '=([^;]*)')); | |
| return match ? match[1] : null; | |
| } | |
| var cid = getCookie("_ga"); | |
| cid = cid.substring(6); | |
| </script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment