title: Google Analytics Video Tracking Issue with JWPlayer 6
body: <p>I'm new to all this and am just not getting how to track a video that can be played on my site. 
  I just installed my GA code to my page, so I'm going to assume that I'm using the new Asynchronous  tracking. the issue is am not able to track this video in GA panel.
  Thanks</p>
  
  <p>My code looks like this . </p>
  
  <pre><code>   &lt;script type='text/javascript' src='js/jwplayer.js'&gt;&lt;/script&gt;
      &lt;script type='text/javascript' src='js/jwplayer.html5.js'&gt;&lt;/script&gt;   
  </code></pre>
  
  <p></p>
  
  <pre><code>   (function (i, s, o, g, r, a, m) {
         i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () {
             (i[r].q = i[r].q || []).push(arguments)
         }, i[r].l = 1 * new Date(); a = s.createElement(o),
    m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m)
     })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
     ga('create', 'UA-40700489-1', 'epcint.com');
     ga('send', 'pageview');
  </code></pre>
  
  <p></p>
  
  <hr>
  
  <pre><code> &lt;script type="text/javascript"&gt;jwplayer.key = "myplayerkey=";&lt;/script&gt; 
  &lt;script type="text/javascript"&gt;
      $(document).ready(function () {
          jwplayer('mediaplayer').setup({
              file: 'video.mp4',
              width: "100%",
              height: "480",
              autostart: true,
              ga: {
  
  
              }
          });
      });
  &lt;/script&gt;
  
  &lt;div id="mediaplayer"&gt;
   &lt;/div&gt;
  </code></pre>
  
  <p>Any help will be highly appriciate 
  Thanks </p>
  
  <blockquote>
    <p>Thanks for your feedback i have updated and Debug the code in GA
    debugger i got the error whats this means ?</p>
    
    <blockquote>
      <p>Initializing Google Analytics. analytics_debug.js:9 Registered new
      plugin: ga(provide, "linker", Function) analytics_debug.js:9
      Registered new plugin: ga(provide, "displayfeatures", Function)
      analytics_debug.js:9 Running command: ga(create, UA-40700489-2,
      infopav.com) analytics_debug.js:9 Creating new tracker: t0
      analytics_debug.js:9 Running command: ga(send, pageview)
      analytics_debug.js:9</p>
      
      <p>Sent beacon:
      v=1&amp;_v=j16d&amp;a=686083534&amp;t=pageview&amp;_s=1&amp;dl=http%3A%2F%2Fdev.www.infopave.com%2FPage%2FIndex%2FHOW_TO_ACCESS_LTPP_DATA&amp;ul=en-us&amp;de=UTF-8…30201944&amp;_u=MCCC~&amp;cid=2101349279.1393503811&amp;tid=UA-40700489-2&amp;z=1727898794</p>
    </blockquote>
    
    <p>analytics_debug.js:9 adSenseId        (&amp;a)   686083534
    analytics_debug.js:9 apiVersion       (&amp;v)   1 analytics_debug.js:9
    clientId         (&amp;cid) 2101349279.1393503811 analytics_debug.js:9
    encoding         (&amp;de)  UTF-8 analytics_debug.js:9 flashVersion<br>
    (&amp;fl)  12.0 r0 analytics_debug.js:9 hitType          (&amp;t)   pageview
    analytics_debug.js:9 javaEnabled      (&amp;je)  1 analytics_debug.js:9
    language         (&amp;ul)  en-us analytics_debug.js:9 location<br>
    (&amp;dl)  <a href="http://dev.www.infopave.com/Page/Index/HOW_TO_ACCESS_LTPP_DATA" rel="nofollow">http://dev.www.infopave.com/Page/Index/HOW_TO_ACCESS_LTPP_DATA</a>
    analytics_debug.js:9 screenColors     (&amp;sd)  24-bit
    analytics_debug.js:9 screenResolution (&amp;sr)  1680x1050
    analytics_debug.js:9 title            (&amp;dt)  LTPP InfoPave - How to
    Access LTPP Data? analytics_debug.js:9 trackingId       (&amp;tid)
    UA-40700489-2 analytics_debug.js:9 viewportSize     (&amp;vp)  1665x429
    analytics_debug.js:9</p>
  
  <pre><code>There was an error while handling a listener: TypeError: Cannot read property 'id' of null function
  </code></pre>
    
    <p>(){if("array"==a.typeOf(m.playlist)&amp;&amp;2>m.playlist.length&amp;&amp;(0==m.playlist.length||
        !m.playlist[0].sources||0==m.playlist[0].sources.length))g();else if(s.getStatus()==a.loaderstatus.COMPLETE){for(var
    e=0;em.modes[e].type;if(r.supportsConfig())return
    r.addEventListener(l.ERROR,d),r.embed(),c(b,f.events),b}m.fallback?(a.log("No
    suitable players found and fallback enabled"),new
    j.download(n,m,g)):(a.log("No suitable players found and fallback
    disabled"),n.parentNode.replaceChild(h,
        n))}} jwplayer.js:3</p>
    
    <p>event.returnValue is deprecated. Please use the standard
    event.preventDefault() instead. jquery-1.8.2.min.js:2 9 Could not add
    internal listener jwplayer.js:3 There was an error calling back an
    event handler </p>
  </blockquote>
  
  <p>Updated Code</p>
  
  <pre><code> $(document).ready(function () {
  
          jwplayer("mediaplayer").setup({
              file: 'rtmp://s1nu7pjztotbeg.cloudfront.net/cfx/st/mp4:Help/How_To/GettingStarted_V2-Sm_x264.mp4',
              width: "100%",
              height: "480",
              autostart: true,
              events: {
                  onComplete: function (evt) {
  
                  },
  
                  onReady: function (event) {
  
                      ga('send', 'event', 'Video Played', 'action', { 'page': 'http://dev.www.infopave.com/Page/Index/HOW_TO_ACCESS_LTPP_DATA' });
  
                  },
                  onPlay: function (evt) {
  
                  },
                  onVolume: function (evt) {
                      alert("the new volume is: " + evt.volume);
                  }
  
  
              },
  
  
              ga: {
  
              }
  
  
          });
  
      });
  </code></pre>
  
  <blockquote>
    <p>i want to send this when some one click the play button ,i want to send this code only</p>
  </blockquote>
  
  <pre><code>               ga('send', 'event', 'Video Played', 'action', { 'page': 'http://dev.www.infopave.com/Page/Index/HOW_TO_ACCESS_LTPP_DATA' });
  </code></pre>
  
  <p>How i can get that button click in jquery thanks for your help...</p>
  
  <blockquote>
    <p>Thanks any help will be highly appriciated</p>
  </blockquote>