An Interest In:
Web News this Week
- April 1, 2024
- March 31, 2024
- March 30, 2024
- March 29, 2024
- March 28, 2024
- March 27, 2024
- March 26, 2024
June 16, 2021 07:45 pm GMT
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
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:
@usefathom I'm using Turbolinks and after navigating to another page, it doesn't get updated in the dashboard. After having a look at the script.js, came up with the solution below. Anything else to do other than this?
cc @JackEllis / @pjrvs
16:27 PM - 28 Mar 2021
and looks like this is the way to go:
Fathom Analytics@usefathom@onerinas @JackEllis @pjrvs Because turbolinks runs its own events, this is the way we typically recommend. I dont think the spa option works with turbolinks. - Jack16:33 PM - 28 Mar 2021
Original Link: https://dev.to/onerinas/make-fathom-analytics-work-with-turbolinks-turbo-in-your-rails-project-2d2i
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To