Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
June 16, 2021 07:45 pm GMT

Make Fathom Analytics work with Turbolinks / Turbo in your Rails project

If you have Turbolinks or Turbo in your Rails project, only the first page view would be counted and tracked by Fathom Analytics. Here is how you can make use of load event to track the page views.

For turbolinks:

document.addEventListener("turbolinks:load", function() {  if (window.fathom) {    window.fathom.trackPageview()  }})

For turbo:

document.addEventListener("turbo:load", function() {  if (window.fathom) {    window.fathom.trackPageview()  }})

I had recently confirmed the same with Fathom team:


and looks like this is the way to go:

Original Link: https://dev.to/onerinas/make-fathom-analytics-work-with-turbolinks-turbo-in-your-rails-project-2d2i

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To