summaryrefslogtreecommitdiff
path: root/plugins/PiwikAnalyticsPlugin.php
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/PiwikAnalyticsPlugin.php')
-rw-r--r--plugins/PiwikAnalyticsPlugin.php15
1 files changed, 5 insertions, 10 deletions
diff --git a/plugins/PiwikAnalyticsPlugin.php b/plugins/PiwikAnalyticsPlugin.php
index 54faa0bdb..fefd09867 100644
--- a/plugins/PiwikAnalyticsPlugin.php
+++ b/plugins/PiwikAnalyticsPlugin.php
@@ -81,25 +81,20 @@ class PiwikAnalyticsPlugin extends Plugin
function onEndShowScripts($action)
{
- $piwikCode = <<<ENDOFPIWIK
-
-<!-- Piwik -->
-<script type="text/javascript">
+ $piwikCode1 = <<<ENDOFPIWIK
var pkBaseURL = (("https:" == document.location.protocol) ? "https://{$this->piwikroot}" : "http://{$this->piwikroot}");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
-</script>
-<script type="text/javascript">
+ENDOFPIWIK;
+ $piwikCode2 = <<<ENDOFPIWIK
try {
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", {$this->piwikId});
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch( err ) {}
-</script>
-<!-- End Piwik Tag -->
-
ENDOFPIWIK;
- $action->raw($piwikCode);
+ $action->inlineScript($piwikCode1);
+ $action->inlineScript($piwikCode2);
return true;
}
}