summaryrefslogtreecommitdiff
path: root/plugins/PiwikAnalyticsPlugin.php
diff options
context:
space:
mode:
authorCraig Andrews <candrews@integralblue.com>2009-12-04 19:41:51 -0500
committerCraig Andrews <candrews@integralblue.com>2009-12-04 19:41:51 -0500
commit4c8bed8ba0558c5834621331f253e05029fa4e43 (patch)
tree796607aa0a8b6a7ce4ef73090a8b255a6b2bacdd /plugins/PiwikAnalyticsPlugin.php
parentaab7344002fd390e5b62a3eb82f3a418fd294617 (diff)
Use inlineScript() everywhere inline scripts are written
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;
}
}