Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mathiasbynens/373528 to your computer and use it in GitHub Desktop.
Save mathiasbynens/373528 to your computer and use it in GitHub Desktop.
Optimized Clicky asynchronous tracking code
/*
* Inspired by (directly copied from) Mathias Bynens' Google Analytics Optimized Snippet
* http://mathiasbynens.be/notes/async-analytics-snippet
* Not fully tested, use at own risk!
*/
<script>
var clicky = { log: function(){ return; }, goal: function(){ return; }},
clicky_site_id = XXXXXX;
(function(d, t) {
var c = d.createElement(t),
s = d.getElementsByTagName(t)[0];
c.async = 1;
c.src = '//static.getclicky.com/js';
s.parentNode.insertBefore(c, s);
})(document, 'script');
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment