Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Retrieves gclid value from cookie and stores in hidden form field id='gclid_field'
- <script>
- function readCookie(name) {
- var n = name + "=";
- var cookie = document.cookie.split(';');
- for(var i=0;i < cookie.length;i++) {
- var c = cookie[i];
- while (c.charAt(0)==' '){c = c.substring(1,c.length);}
- if (c.indexOf(n) == 0){return c.substring(n.length,c.length);}
- }
- return null;
- }
- window.onload = function() {
- document.getElementById('gclid_field').value =
- readCookie('gclid');
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement