title: How can I force the __utmz cookie to be set on the first page load
body: <p>I am using a sweet little function to track visitors to my site and dump the info to Salesforce.  However many form submissions have (none) set for many values because (as I understand it) the cookie is not set until the second page load.  </p>
  
  <p>I have tested this and that seems to be accurate, the problem is many people fill out a form on the first page, and I don't get any info through these submissions. </p>
  
  <p>I am loading GA as follows: </p>
  
  <pre><code>  &lt;script type="text/javascript"&gt;
  
    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-29066630-1']);
    _gaq.push(['_trackPageview']);
  
    (function() {
      var ga = document.createElement('script');
      ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 
          'http://www') + '.google-analytics.com/ga.js';
      ga.setAttribute('async', 'true');
      document.documentElement.firstChild.appendChild(ga);
    })();
  
  
  &lt;/script&gt;
  </code></pre>
  
  <p>And then running a php function to parse the __utmz cookie apart:</p>
  
  <pre><code>function tracking_cookie() { // ver 1.5
      $trackarr   = split('[|]',$_COOKIE["__utmz"]);
      $conversion = $_COOKIE["Conversion"];
  
      for($i=0;$i&lt;count($trackarr);$i++){
          $keyvalues=split('[=]',$trackarr[$i]);
          $key=substr($keyvalues[0],-6);      
          switch ($key){
              case "utmcsr":
                  $cookie['SearchEngine']     =   $keyvalues[1];break;
              case "utmccn":
                  $cookie['SearchCampaign']   =   $keyvalues[1];break;
              case "utmcmd":
                  $cookie['SearchType']       =   $keyvalues[1];break;
              case "utmcct":
                  $cookie['AdText']           =   $keyvalues[1];break;
              case "utmctr":
                  $cookie['Keyword']          =   $keyvalues[1];break;
              case "mgclid":
                  $cookie['isPPC']            =   $keyvalues[1];break;
          }
      }
  </code></pre>
  
  <p>I have more code running after this.  Any ideas on how to force the cookie to load the first time around?</p>