Fix javascript syntax for Google Analytics event tracking
[busui.git] / include / common-template.inc.php
blob:a/include/common-template.inc.php -> blob:b/include/common-template.inc.php
--- a/include/common-template.inc.php
+++ b/include/common-template.inc.php
@@ -236,7 +236,7 @@
 }
 function trackEvent($category, $action, $label = "", $value = -1) {
   if (isAnalyticsOn()) {
-    echo "<script> _gaq.push(['_trackEvent', $category, $action".($label != "" ? ", $label" : "").($value != -1 ? ", $value" : "")."]);</script>";
+    echo "\n<script> _gaq.push(['_trackEvent', '$category', '$action'".($label != "" ? ", '$label'" : "").($value != -1 ? ", $value" : "")."]);</script>";
   }
 }
 ?>