Fix javascript syntax for Google Analytics event tracking
--- 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>";
}
}
?>