Tom Connole


50 Experience
0 Lessons Completed
0 Questions Solved


Hi, has anyone had the issue of their home page pageview firing twice for one page view in rails 6 when they've installed Segment? I've added the Turbolinks snippet, but not sure where the problem lies.

Would having an event listener on turbolinks loading twice for different purposes cause this?

document.addEventListener("turbolinks:load", () => {

document.addEventListener("turbolinks:load", function() {

I've kind of mashed together the Bootstrap tutorial, Segment tutorial and installing javascript in rails 6 tutorial together - successfully, except for this.

Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more.

© 2024 GoRails, LLC. All rights reserved.