Advertisement
bender-nvkz

getClientId()

Apr 11th, 2017
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function getClientId(){
  2.     var clid = undefined;
  3.     var match = document.cookie.match('(?:^|;)\\s*_ga=([^;]*)');
  4.     var raw = (match) ? decodeURIComponent(match[1]) : null;
  5.     if (raw)
  6.     {
  7.         match = raw.match(/(\d+\.\d+)$/);
  8.     }
  9.     var gacid = (match) ? match[1] : null;
  10.     if (gacid)
  11.     {
  12.         clid=gacid;
  13.     }else{
  14.  
  15.         clid=(gga_obj && 'clientId' in gga_obj)?gga_obj['clientId']:undefined;
  16.     }
  17.     return clid;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement