JW has an API that allows you to have many actions in response to the player events. Google analytics also provides a great API, is probably the best and least expensive way of tracking these events.

This is a very simple example on how to track which users are currently playing a live stream.

The GA code

Get an GA account and its code (you can skip this if you already are using it):

	<script type="text/javascript">

	  var _gaq = _gaq || [];
	  // Set your UA number	
	  _gaq.push(['_setAccount', 'UA-******-*']);
	  // Disable the default pageview tracking - OPTIONAL

	  (function() {
		var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
		ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
		var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);


Using the JW API and pushing to GA

This is our code, where we set an interval of 60000 miliseconds for a loop that checks if JW Player is in “PLAYING” state. If so, a event and a pageview are pushed to GA (you can customize this in any way you like):

	<script type="text/javascript">
				if (jwplayer().getState()=="PLAYING"){
					_gaq.push(['_trackEvent', 'Live streaming', 'Concurrente', 'Live streaming']);
					_gaq.push(['_trackPageview', 'concurrente_supermasita']);


Using GA Realtime

In your GA panel you should see something like this: