Skip to content

Instantly share code, notes, and snippets.

@boffey
Created January 30, 2013 10:17
Show Gist options
  • Save boffey/4672209 to your computer and use it in GitHub Desktop.
Save boffey/4672209 to your computer and use it in GitHub Desktop.
Twitter Tracking JS
window.twttr = (function (d,s,id) {
var t, js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return; js=d.createElement(s); js.id=id;
js.src="//platform.twitter.com/widgets.js"; fjs.parentNode.insertBefore(js, fjs);
return window.twttr || (t = { _e: [], ready: function(f){ t._e.push(f) } });
}(document, "script", "twitter-wjs"));
twttr.ready(function (twttr) {
twttr.events.bind('tweet', function(event) {
// Track Twitter
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment