reed / turbolinks-compatibility

A collection of tutorials for how to get your favorite javascript libraries, plugins, and snippets working with Turbolinks.
reed.github.io/turbolinks-compatibility
MIT License
147 stars 35 forks source link

Marketo munchkin tracker integration request #63

Open ThomasBush opened 8 years ago

ThomasBush commented 8 years ago

I am currently using the following code, but I was wondering if there is a recommended setup.

<script type="text/javascript">
$.ajax({
  url: '//munchkin.marketo.net/munchkin.js',
  dataType: 'script',
  cache: true,
  success: function() {
    Munchkin.init('123-ABC-456', {asyncOnly: true});
  }
});
</script>

This code is placed in the body of each page, so I am essentially avoiding turbolinks, is this what everyone else is doing?