Add piwik script in html instead of dynamically
Instead of adding the piwik javascript dynamically in javascript, add it using a script tag in "templates/default.html". Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
This commit is contained in:
parent
0d7faa8d8f
commit
32d3101989
@ -114,21 +114,15 @@ var _paq = _paq || [];
|
||||
};
|
||||
|
||||
function init () {
|
||||
var u = "//analytics.rekahsoft.ca/",
|
||||
d = document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
|
||||
|
||||
_paq.push(["setDoNotTrack", true]);
|
||||
_paq.push(['enableLinkTracking']);
|
||||
_paq.push(['setTrackerUrl', u+'piwik.php']);
|
||||
_paq.push(['setSiteId', 1]);
|
||||
|
||||
// Asynchronously load piwik.js
|
||||
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
|
||||
_paq.push(["enableLinkTracking"]);
|
||||
_paq.push(["setTrackerUrl", "//analytics.rekahsoft.ca/piwik.php"]);
|
||||
_paq.push(["setSiteId", 1]);
|
||||
}
|
||||
|
||||
function trackPageView (href) {
|
||||
_paq.push(['setDocumentTitle', document.domain + href]);
|
||||
_paq.push(['trackPageView']);
|
||||
_paq.push(["setDocumentTitle", document.domain + href]);
|
||||
_paq.push(["trackPageView"]);
|
||||
}
|
||||
|
||||
return spec
|
||||
|
@ -24,7 +24,8 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- Piwik (no js)-->
|
||||
<!-- Piwik -->
|
||||
<script type="text/javascript" async defer src="//analytics.rekahsoft.ca/piwik.js"></script>
|
||||
<noscript><img src="//analytics.rekahsoft.ca/piwik.php?idsite=1" style="border:0;display:none;" alt="" /></noscript>
|
||||
|
||||
$partial("templates/partials/logo-banner.html")$
|
||||
|
Loading…
Reference in New Issue
Block a user