title: Parsing __utmz tracking cookie to get referral
body: <p>I use Google Analytics on my site, and I want to read __umtz cookie to get referring link. I made some research and I wrote such code:</p>
  
  <pre><code>$refer=explode('utmcsr=',$_COOKIE['__utmz']);
  if(count($refer)&gt;1) $refer=explode('|',$refer[1]);
  $refer=addslashes($refer[0]);
  </code></pre>
  
  <p>The problem is, this is not always working, sometimes I get junk as result. What I am doing wrong? Maybe someone have a good description of this cookie?</p>