Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/hossainemruz/toha.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Davó <david@ddavo.me>2022-08-18 19:56:16 +0300
committerGitHub <noreply@github.com>2022-08-18 19:56:16 +0300
commiteefb6166ebe4729927cff10d47cac63b94e29f6a (patch)
tree64292a9f0e6f6aac763e2fb1de4bd3b89b2ba231
parent55dd90a0dda051791e6238614337a42ed2192612 (diff)
Added matomo support (#633)
-rw-r--r--README.md1
-rw-r--r--layouts/partials/analytics.html18
2 files changed, 19 insertions, 0 deletions
diff --git a/README.md b/README.md
index 5f4c695..a36261e 100644
--- a/README.md
+++ b/README.md
@@ -34,6 +34,7 @@ A [Hugo](https://gohugo.io/) theme for a personal portfolio with minimalist desi
- GoatCounter
- counter.dev
- Google Analytics
+ - Matomo/Piwik
- Comment Support
- [Disqus](https://disqus.com/)
- [Valine](https://valine.js.org/)
diff --git a/layouts/partials/analytics.html b/layouts/partials/analytics.html
index 74adeae..11d507d 100644
--- a/layouts/partials/analytics.html
+++ b/layouts/partials/analytics.html
@@ -40,6 +40,24 @@
src="//gc.zgo.at/count.js"
></script>
{{ end }}
+
+ <!-- Piwik/Matomo -->
+ {{ with .matomo }}
+ <!-- Matomo -->
+ <script>
+ var _paq = window._paq = window._paq || [];
+ /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
+ _paq.push(['trackPageView']);
+ _paq.push(['enableLinkTracking']);
+ (function() {
+ var u="//{{ .instance }}/";
+ _paq.push(['setTrackerUrl', u+'matomo.php']);
+ _paq.push(['setSiteId', '{{ .siteId }}']);
+ var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
+ g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
+ })();
+ </script>
+ {{ end }}
{{ end }}
{{ end }}