diff options
author | Jason Stryker <public@jasonstryker.com> | 2018-09-20 00:51:40 +0300 |
---|---|---|
committer | Jason Stryker <public@jasonstryker.com> | 2018-09-20 00:51:40 +0300 |
commit | 85b10e604bfd1dbb8fd7abcebe239f513b796b98 (patch) | |
tree | 1b56b684ff3332aefc04d3e4edb7e8a180006452 | |
parent | 56ff465751b8feb1f3792e7b7edf5b37898a6bc9 (diff) |
add fathom analytics support
-rw-r--r-- | exampleSite/config.toml | 3 | ||||
-rw-r--r-- | layouts/partials/analytics/fathom.html | 12 | ||||
-rw-r--r-- | layouts/partials/footer.html | 3 |
3 files changed, 18 insertions, 0 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml index b907972..c7695c0 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -48,6 +48,9 @@ codepen = "" siteID = 1 rootURL = "//matomo.example.com/" +[params.fathomAnalytics] +rootURL = "//fathom.example.com/" + [taxonomies] tag ="tags" diff --git a/layouts/partials/analytics/fathom.html b/layouts/partials/analytics/fathom.html new file mode 100644 index 0000000..7191265 --- /dev/null +++ b/layouts/partials/analytics/fathom.html @@ -0,0 +1,12 @@ +<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.rootURL }}tracker.js', 'fathom'); + fathom('trackPageview'); +</script>
\ No newline at end of file diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index baf88d9..707adf1 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -12,5 +12,8 @@ {{ if .Site.Params.matomoAnalytics }} {{- partial "analytics/matomo" . -}} {{ end }} +{{ if .Site.Params.fathomAnalytics }} +{{- partial "analytics/fathom" . -}} +{{ end }} </body> </html> |