summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2018-10-16 15:55:27 +0200
committerHarald Eilertsen <haraldei@anduin.net>2018-10-16 15:55:27 +0200
commit56572aa529cb5eb96be6a12a363ec464bc82f2df (patch)
tree973ab8b5296fa3630a321319535a92a7b0d26d59
parentac567c9da4394ef242785ef916127108eca0981a (diff)
downloadnorsk-urskog-main-56572aa529cb5eb96be6a12a363ec464bc82f2df.tar.gz
norsk-urskog-main-56572aa529cb5eb96be6a12a363ec464bc82f2df.tar.bz2
norsk-urskog-main-56572aa529cb5eb96be6a12a363ec464bc82f2df.zip
Legg til sporing for matomo besøksstatistikk.
-rw-r--r--blog/_config.yml3
-rw-r--r--blog/_includes/head.html1
-rw-r--r--blog/_includes/matomo.html15
3 files changed, 19 insertions, 0 deletions
diff --git a/blog/_config.yml b/blog/_config.yml
index 2ca6a88..8a91acb 100644
--- a/blog/_config.yml
+++ b/blog/_config.yml
@@ -20,6 +20,9 @@ collections:
future: true
permalink: pretty
+matomo_instance_url: "https://volse.anduin.net/piwik/"
+matomo_site_id: 6
+
defaults:
-
scope:
diff --git a/blog/_includes/head.html b/blog/_includes/head.html
index 08367a9..1c54ccb 100644
--- a/blog/_includes/head.html
+++ b/blog/_includes/head.html
@@ -12,4 +12,5 @@
{% include opengraph.html %}
<link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl_root | prepend: site.url }}">
{% stylesheet main %}
+ {% include matomo.html %}
</head>
diff --git a/blog/_includes/matomo.html b/blog/_includes/matomo.html
new file mode 100644
index 0000000..bf8cab8
--- /dev/null
+++ b/blog/_includes/matomo.html
@@ -0,0 +1,15 @@
+<!-- Matomo -->
+<script type="text/javascript">
+ var _paq = _paq || [];
+ /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
+ _paq.push(['trackPageView']);
+ _paq.push(['enableLinkTracking']);
+ (function() {
+ var u="{{ site.matomo_instance_url }}";
+ _paq.push(['setTrackerUrl', u+'piwik.php']);
+ _paq.push(['setSiteId', '{{ site.matomo_site_id }}']);
+ var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
+ g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
+ })();
+</script>
+<!-- End Matomo Code -->