We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Just wanted to drop this link here - https://segment.com/docs/sources/server/ruby/#turbolinks
Segment.com have documented what needs to be done to get Turbolinks support working
The text was updated successfully, but these errors were encountered:
The solution is basically to have the script in two places.
In your <head>:
<head>
!function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","once","off","on"];analytics.factory=function(t){return function(){var e=Array.prototype.slice.call(arguments);e.unshift(t);analytics.push(e);return analytics}};for(var t=0;t<analytics.methods.length;t++){var e=analytics.methods[t];analytics[e]=analytics.factory(e)}analytics.load=function(t){var e=document.createElement("script");e.type="text/javascript";e.async=!0;e.src=("https:"===document.location.protocol?"https://":"http://")+"cdn.segment.com/analytics.js/v1/"+t+"/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(e,n)};analytics.SNIPPET_VERSION="4.0.0"; analytics.load("#{ENV['SEGMENT_WRITE_KEY']}"); }}();
In your <body>:
<body>
if (window.analytics) { window.analytics.page(); analytics.identify('#{current_user.id}', { name: '#{current_user.name}', email: '#{current_user.email}', }); }
Sorry, something went wrong.
No branches or pull requests
Just wanted to drop this link here - https://segment.com/docs/sources/server/ruby/#turbolinks
Segment.com have documented what needs to be done to get Turbolinks support working
The text was updated successfully, but these errors were encountered: