playground: add Google analytics for Run/Share button clicks.

Change-Id: Iad4cd4c8f0612f062c232a577eb1a95a2a912375
Reviewed-on: https://go-review.googlesource.com/10880
Reviewed-by: Andrew Gerrand <adg@golang.org>
diff --git a/app/goplay/edit.html b/app/goplay/edit.html
index 7339738..277a6ee 100644
--- a/app/goplay/edit.html
+++ b/app/goplay/edit.html
@@ -49,6 +49,15 @@
 			$('#imports').change(function() {
 				createCookie('playgroundImports', $(this).is(':checked') ? 'true' : '');
 			});
+			// Fire Google Analytics events for Run/Share button clicks.
+			if (window.trackEvent) {
+				$('#run').click(function() {
+					window.trackEvent('playground', 'click', 'run-button');
+				});
+				$('#share').click(function() {
+					window.trackEvent('playground', 'click', 'share-button');
+				});
+			}
 		});
 
 		function createCookie(name, value) {