Add Fathom, Matomo, Plausible, Yandex web analytics

master
Will Faught 3 years ago
parent a46757337f
commit 08093d935c

@ -177,8 +177,13 @@ paige_bootstrap_icons: "/my-assets/my-bootstrap-icons.css" # Use local Bootstrap
paige_bootstrap_scripts: "/my-assets/my-bootstrap.bundle.min.js" # Use local Bootstrap scripts paige_bootstrap_scripts: "/my-assets/my-bootstrap.bundle.min.js" # Use local Bootstrap scripts
paige_bootstrap_styles: "/my-assets/my-bootstrap.min.css" # Use local Bootstrap styles paige_bootstrap_styles: "/my-assets/my-bootstrap.min.css" # Use local Bootstrap styles
paige_date_format: "2006 January 2" # Hugo date format for page dates paige_date_format: "2006 January 2" # Hugo date format for page dates
paige_fathom_id: "123456" # usefathom.com account ID
paige_hide_theme_comment: true # Don't put a link to this project in a code comment paige_hide_theme_comment: true # Don't put a link to this project in a code comment
paige_hide_theme_link: true # Don't put a link to this project in the footer paige_hide_theme_link: true # Don't put a link to this project in the footer
paige_matomo_id: "123456" # matomo.org account ID
paige_matomo_url: "https://example.com/123456" # matomo.org account URL
paige_plausible_id: "123456" # plausible.io account ID
paige_yandex_id: "123456" # metrica.yandex.com account ID
``` ```
If you set either `paige_hide_theme_comment` or `paige_hide_theme_link`, please credit this project in a post to help others find it. If you set either `paige_hide_theme_comment` or `paige_hide_theme_link`, please credit this project in a post to help others find it.

@ -10,3 +10,30 @@
{{ if .Site.GoogleAnalytics }} {{ if .Site.GoogleAnalytics }}
{{ template "_internal/google_analytics.html" . }} {{ template "_internal/google_analytics.html" . }}
{{ end }} {{ end }}
{{ with .Site.Params.paige_fathom_id }}
<script data-site="{{ . }}" defer src="https://cdn.usefathom.com/script.js"></script>
{{ end }}
{{ if and .Site.Params.paige_matomo_id .Site.Params.paige_matomo_url }}
<script type="text/javascript">
var _paq = window._paq = window._paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//{{ .Site.Params.paige_matomo_url }}/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '{{ .Site.Params.paige_matomo_id }}']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
{{ end }}
{{ with .Site.Params.paige_plausible_id }}
<script data-domain="{{ . }}" defer src="https://plausible.io/js/script.js"></script>
{{ end }}
{{ with .Site.Params.paige_yandex_id }}
<script>
(function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};m[i].l=1*new Date();k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)})
(window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym");
ym("{{ . }}", "init", {});
</script>
{{ end }}

Loading…
Cancel
Save