Revert "Revert "add matomo""
This commit is contained in:
parent
9c2069fb53
commit
a2ac683f1c
2 changed files with 25 additions and 0 deletions
|
@ -28,6 +28,7 @@ twitter = "@SalarRahmanian"
|
||||||
largeTwitterCard = false
|
largeTwitterCard = false
|
||||||
introDescription = "Software Engineer based in San Francisco Bay Area."
|
introDescription = "Software Engineer based in San Francisco Bay Area."
|
||||||
ga_analytics = "UA-47014432-1"
|
ga_analytics = "UA-47014432-1"
|
||||||
|
enableMatomo = true
|
||||||
numberOfTagsShown = 14
|
numberOfTagsShown = 14
|
||||||
fallBackOgImage = "salar.jpg"
|
fallBackOgImage = "salar.jpg"
|
||||||
codeMaxLines = 10
|
codeMaxLines = 10
|
||||||
|
|
24
layouts/partials/analytics.html
Normal file
24
layouts/partials/analytics.html
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
{{- with .Site.Params.ga_analytics }}
|
||||||
|
<script async src="https://www.googletagmanager.com/gtag/js?id={{ . }}"></script>
|
||||||
|
<script>
|
||||||
|
window.dataLayer = window.dataLayer || [];
|
||||||
|
function gtag(){dataLayer.push(arguments);}
|
||||||
|
gtag('js', new Date());
|
||||||
|
gtag('config', '{{ . }}');
|
||||||
|
</script>
|
||||||
|
{{- end -}}
|
||||||
|
{{- with .Site.Params.enableMatomo }}
|
||||||
|
<script>
|
||||||
|
var _paq = window._paq = window._paq || [];
|
||||||
|
_paq.push(['trackPageView']);
|
||||||
|
_paq.push(['enableLinkTracking']);
|
||||||
|
(function() {
|
||||||
|
var u="//softinio.dev/matomo/";
|
||||||
|
_paq.push(['setTrackerUrl', u+'matomo.php']);
|
||||||
|
_paq.push(['setSiteId', '1']);
|
||||||
|
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 -}}
|
||||||
|
|
Loading…
Reference in a new issue