Installing Drift on a Turbolinks site

Updated 5 months ago ​by Matt Bilotti

Turbolinks 5+

Turbolinks is a JavaScript plugin for Rails that makes your website behave more like a single-page app. This can make your site feel a lot faster for users, but can cause some problems for third party JavaScript that runs on your site. If you notice that the Drift widget disappears as soon as you navigate to a new URL, you can add following HTML to the end of the body tag of your site’s main template.

<div id="drift-widget-container" data-turbolinks-permanent></div><br>

Now you should see the Drift widget load on every page instead of just the first. You can read more about persisting elements across page loads in the Turbolinks docs.

Turbolinks Classic (2.x)

At this time older versions of Turbolinks are not directly supported. If this is something your business depends on please drop us a note and let us know.


Was this article helpful?

Can’t find what you’re looking for?

Talk To Us