Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ribice/kiss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Stryker <public@jasonstryker.com>2018-09-20 00:51:40 +0300
committerJason Stryker <public@jasonstryker.com>2018-09-20 00:51:40 +0300
commit85b10e604bfd1dbb8fd7abcebe239f513b796b98 (patch)
tree1b56b684ff3332aefc04d3e4edb7e8a180006452
parent56ff465751b8feb1f3792e7b7edf5b37898a6bc9 (diff)
add fathom analytics support
-rw-r--r--exampleSite/config.toml3
-rw-r--r--layouts/partials/analytics/fathom.html12
-rw-r--r--layouts/partials/footer.html3
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>