From 32d310198926adee47d7069641478971d8c9341a Mon Sep 17 00:00:00 2001 From: "Collin J. Doering" Date: Thu, 20 Aug 2015 02:08:14 -0400 Subject: [PATCH] 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 --- js/default.js | 16 +++++----------- templates/default.html | 3 ++- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/js/default.js b/js/default.js index 40f1d19..51cd4de 100644 --- a/js/default.js +++ b/js/default.js @@ -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 diff --git a/templates/default.html b/templates/default.html index 5af6401..3f2287c 100644 --- a/templates/default.html +++ b/templates/default.html @@ -24,7 +24,8 @@ - + + $partial("templates/partials/logo-banner.html")$