Rails 4 turbolinks with Google Analytics

前端 未结 8 786
陌清茗
陌清茗 2020-12-07 19:14

I\'m wondering what is the best way to implement Google Analytics tracking code along with the turbo linking in Rails 4. Will the normal snippet work? I\'ve also seen a gems

8条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-07 19:44

    This solution has worked the best for me: http://reed.github.io/turbolinks-compatibility/google_analytics.html.

    It requires at least Turbolinks v2.1.0 or greater.

提交回复
热议问题