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

github.com/leonardofaria/bento.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonardo Faria <leonardofaria@gmail.com>2020-08-03 23:39:41 +0300
committerLeonardo Faria <leonardofaria@gmail.com>2020-08-03 23:39:41 +0300
commit069c0f5e8a43e5fec386e2ad82865a24504b75de (patch)
tree865d796e200199ee94603e487e3b81b14decb73d
parentb16a5e74212b5f0c11a4503a88c0360fd72212a9 (diff)
Add Turbolinks support in Fathom
-rw-r--r--layouts/partials/fathom.html6
1 files changed, 6 insertions, 0 deletions
diff --git a/layouts/partials/fathom.html b/layouts/partials/fathom.html
index a1a29e9..4536a34 100644
--- a/layouts/partials/fathom.html
+++ b/layouts/partials/fathom.html
@@ -10,4 +10,10 @@
})(document, window, '//{{ .Site.Params.fathomAnalytics.serverURL | default "cdn.usefathom.com" }}/tracker.js', 'fathom');
fathom('set', 'siteId', '{{ .Site.Params.fathomAnalytics.siteID }}');
fathom('trackPageview');
+
+ document.addEventListener('turbolinks:load', (e) => {
+ if (typeof window.fathom === 'function') {
+ window.fathom('trackPageview');
+ }
+ });
</script>