diff options
author | Leonardo Faria <leonardofaria@gmail.com> | 2020-08-03 23:25:36 +0300 |
---|---|---|
committer | Leonardo Faria <leonardofaria@gmail.com> | 2020-08-03 23:25:36 +0300 |
commit | b16a5e74212b5f0c11a4503a88c0360fd72212a9 (patch) | |
tree | e6b438038e4f1c626fa7e6343473dd5cb6c9c580 /layouts | |
parent | 21152d6f51e58a1451effbf602990da5a0057f62 (diff) |
Add Fathom Analytics support
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/partials/fathom.html | 13 | ||||
-rw-r--r-- | layouts/partials/footer.html | 4 |
2 files changed, 17 insertions, 0 deletions
diff --git a/layouts/partials/fathom.html b/layouts/partials/fathom.html new file mode 100644 index 0000000..a1a29e9 --- /dev/null +++ b/layouts/partials/fathom.html @@ -0,0 +1,13 @@ +<script> + (function(f, a, t, h, o, m){ + a[h]=a[h]||function(){ + (a[h].q=a[h].q||[]).push(arguments) + }; + o=f.createElement('script'), + m=f.getElementsByTagName('script')[0]; + o.async=1; o.src=t; o.id='fathom-script'; + m.parentNode.insertBefore(o,m) + })(document, window, '//{{ .Site.Params.fathomAnalytics.serverURL | default "cdn.usefathom.com" }}/tracker.js', 'fathom'); + fathom('set', 'siteId', '{{ .Site.Params.fathomAnalytics.siteID }}'); + fathom('trackPageview'); +</script> diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 0a3417b..54d6c8f 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -72,3 +72,7 @@ </script> {{end}} {{ template "_internal/google_analytics.html" . }} + +{{ if and .Site.Params.fathomAnalytics .Site.Params.fathomAnalytics.siteID }} + {{- partial "fathom" . -}} +{{ end }}
\ No newline at end of file |