Created
September 5, 2015 18:08
-
-
Save macool/7b78f87b63f2ab86fa8d to your computer and use it in GitHub Desktop.
gauges to work with turbolinks on rails
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var _gauges = _gauges || []; | |
$(document).on("ready", function() { | |
var SITE_ID = '****'; | |
var t = document.createElement('script'); | |
t.type = 'text/javascript'; | |
t.async = true; | |
t.id = 'gauges-tracker'; | |
t.setAttribute('data-site-id', SITE_ID); | |
t.setAttribute('data-track-path', 'https://track.gaug.es/track.gif'); | |
t.src = 'https://track.gaug.es/track.js'; | |
var s = document.getElementsByTagName('script')[0]; | |
s.parentNode.insertBefore(t, s); | |
}); | |
$(document).on("page:load", function () { | |
_gauges.push(['track']); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment