Move analytics config to paige object
This commit is contained in:
18
README.md
18
README.md
@@ -177,18 +177,20 @@ 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_styles: "/my-assets/my-bootstrap.min.css" # Use local Bootstrap styles
|
||||
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_link: true # Don't put a link to this project in the footer
|
||||
|
||||
# Analytics
|
||||
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
|
||||
|
||||
# Comments
|
||||
paige:
|
||||
analytics:
|
||||
fathom: # usefathom.com
|
||||
account_id: "123456"
|
||||
matomo: # matomo.org
|
||||
account_id: "123456"
|
||||
host_url: "https://example.com"
|
||||
plausible: # plausible.io
|
||||
account_id: "123456"
|
||||
yandex: # metrica.yandex.com
|
||||
account_id: "123456"
|
||||
comments:
|
||||
cactus: # cactus.chat
|
||||
account_id: "123456"
|
||||
|
@@ -10,30 +10,30 @@
|
||||
{{ if .Site.GoogleAnalytics }}
|
||||
{{ template "_internal/google_analytics.html" . }}
|
||||
{{ end }}
|
||||
{{ with .Site.Params.paige_fathom_id }}
|
||||
<script data-site="{{ . }}" defer src="https://cdn.usefathom.com/script.js"></script>
|
||||
{{ with .Site.Params.paige.analytics.fathom }}
|
||||
<script data-site="{{ .account_id }}" defer src="https://cdn.usefathom.com/script.js"></script>
|
||||
{{ end }}
|
||||
{{ if and .Site.Params.paige_matomo_id .Site.Params.paige_matomo_url }}
|
||||
{{ with .Site.Params.paige.analytics.matomo }}
|
||||
<script type="text/javascript">
|
||||
var _paq = window._paq = window._paq || [];
|
||||
_paq.push(['trackPageView']);
|
||||
_paq.push(['enableLinkTracking']);
|
||||
(function() {
|
||||
var u="//{{ .Site.Params.paige_matomo_url }}/";
|
||||
var u="//{{ .host_url }}/";
|
||||
_paq.push(['setTrackerUrl', u+'matomo.php']);
|
||||
_paq.push(['setSiteId', '{{ .Site.Params.paige_matomo_id }}']);
|
||||
_paq.push(['setSiteId', '{{ .account_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>
|
||||
{{ with .Site.Params.paige.analytics.plausible }}
|
||||
<script data-domain="{{ .account_id }}" defer src="https://plausible.io/js/script.js"></script>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.paige_yandex_id }}
|
||||
{{ with .Site.Params.paige.analytics.yandex }}
|
||||
<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", {});
|
||||
ym("{{ .account_id }}", "init", {});
|
||||
</script>
|
||||
{{ end }}
|
||||
|
Reference in New Issue
Block a user