title: Send Analytics event from background chrome extension
body: <p>I'm trying to send an event to Google Analytics from background.js (the background script) of my chrome extension.</p>
  
  <p>I put this code in my background.js file</p>
  
  <pre><code>var _gaq = _gaq || [];
  _gaq.push(['_setAccount', _AnalyticsCode]);
  _gaq.push(['_trackPageview']);
  
  (function() {
    var ga = document.createElement('script');
    ga.type = 'text/javascript';
    ga.async = true;
    ga.src = 'https://ssl.google-analytics.com/ga.js';
    ga.checkProtocolTask = null;
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(ga, s);
  })();
  </code></pre>
  
  <p>and I try to send this event:</p>
  
  <pre><code> _gaq.push(['_trackEvent', 'event_send', 'event_label');
  </code></pre>
  
  <p>but Im not seeing the event on Analytics dashboard.
  I also added to my <code>manifest.json</code> file this line:
  <code>
  "content_security_policy": "script-src 'self' https://ssl.google-analytics.com; object-src 'self'",
  </code> 
  What do I need to do to make it work from the background? </p>