title: checking if the Google Analytics _gaq object is loaded and available
body: <p>I have some Google Analytics Tracking Code (GATC) on my site which triggers calls to the <code>_gaq.push</code> method in Google's code.</p>
  
  <p>In the scenario that GA is not available, or <code>_gaq</code> has not loaded, I want to ensure that I do not have any JavaScript errors on the page. By checking that <code>_gaq</code> is not identical to 'undefined' - will this suffice to check if it's available and is this x-browser? I've had a look at Google's documentation, but it doesn't mention anything about this.</p>
  
  <p>I'm aware of checking if the object is <code>null</code>, but i'm not sure if this is necessary.</p>
  
  <pre><code>if (typeof(_gaq) !== 'undefined') {
     _gaq.push(['_trackEvent', 'Downloaded Video', 'Yes']); 
     _gaq.push(['rollup._trackEvent', 'Downloaded Video', 'Yes']);                                    
  }
  </code></pre>