turbolinks / turbolinks-classic

Classic version of Turbolinks. Now deprecated in favor of Turbolinks 5.
MIT License
3.54k stars 428 forks source link

Another google analytics file "analytics.js" gets added on every page load and stacks #626

Closed gregblass closed 8 years ago

gregblass commented 8 years ago

Every turbolinks page load adds another analytics.js file to the page.

<script async="" src="//www.google-analytics.com/analytics.js"></script>

Navigate 10 times and 10 of those will be inserted. It makes sense because the analytics code snippet adds it to the top of the page.

Has anyone successfully dealt with this that could recommend a best practice?

gregblass commented 8 years ago

Solution I came up with is to just put in the head tag instead of the body.