Skip to content

Instantly share code, notes, and snippets.

Revisions

  1. mathiasbynens revised this gist Apr 21, 2010. 2 changed files with 19 additions and 21 deletions.
    21 changes: 0 additions & 21 deletions Optimized Clicky Async Tracking Code
    Original file line number Diff line number Diff line change
    @@ -1,21 +0,0 @@
    /*
    * Inspired by (directly copied from) Mathias Bynens' optimized Google Analytics snippet
    * http://mathiasbynens.be/notes/async-analytics-snippet
    * Not fully tested, use at own risk!
    */

    <script>
    var f = Function(),
    clicky = { log: f, goal: f },
    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>

    <!-- This supports tracking for users with JavaScript disabled. This should go in <body> -->
    <noscript><img alt="" width="1" height="1" src="http://in.getclicky.com/XXXXXXns.gif" /></noscript>
    19 changes: 19 additions & 0 deletions Optimized Clicky Asynchronous Tracking Code
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    /*
    * See http://mathiasbynens.be/notes/async-analytics-snippet#comment-14
    */

    <script>
    var f = Function(),
    clicky = { log: f, goal: f },
    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>

    <!-- This supports tracking for users with JavaScript disabled. This should go in <body> -->
    <noscript><img alt="" width="1" height="1" src="http://in.getclicky.com/XXXXXXns.gif" /></noscript>
  2. mathiasbynens revised this gist Apr 21, 2010. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions Optimized Clicky Async Tracking Code
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,8 @@
    */

    <script>
    var clicky = { log: function(){ return; }, goal: function(){ return; }},
    var f = Function(),
    clicky = { log: f, goal: f },
    clicky_site_id = XXXXXX;
    (function(d, t) {
    var c = d.createElement(t),
    @@ -16,5 +17,5 @@ var clicky = { log: function(){ return; }, goal: function(){ return; }},
    })(document, 'script');
    </script>

    <!-- This supports tracking for users with Javascript disabled. This should go in <body> -->
    <!-- This supports tracking for users with JavaScript disabled. This should go in <body> -->
    <noscript><img alt="" width="1" height="1" src="http://in.getclicky.com/XXXXXXns.gif" /></noscript>
  3. @robflaherty robflaherty revised this gist Apr 20, 2010. 1 changed file with 5 additions and 2 deletions.
    7 changes: 5 additions & 2 deletions Optimized Clicky Async Tracking Code
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    /*
    * Inspired by (directly copied from) Mathias Bynens' Google Analytics Optimized Snippet
    * Inspired by (directly copied from) Mathias Bynens' optimized Google Analytics snippet
    * http://mathiasbynens.be/notes/async-analytics-snippet
    * Not fully tested, use at own risk!
    */
    @@ -14,4 +14,7 @@ var clicky = { log: function(){ return; }, goal: function(){ return; }},
    c.src = '//static.getclicky.com/js';
    s.parentNode.insertBefore(c, s);
    })(document, 'script');
    </script>
    </script>

    <!-- This supports tracking for users with Javascript disabled. This should go in <body> -->
    <noscript><img alt="" width="1" height="1" src="http://in.getclicky.com/XXXXXXns.gif" /></noscript>
  4. @robflaherty robflaherty revised this gist Apr 20, 2010. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Optimized Clicky Async Tracking Code
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@
    * 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; }},
  5. @robflaherty robflaherty revised this gist Apr 20, 2010. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions Optimized Clicky Async Tracking Code
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,9 @@
    /*
    * 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;
  6. @robflaherty robflaherty created this gist Apr 20, 2010.
    11 changes: 11 additions & 0 deletions Optimized Clicky Async Tracking Code
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    <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>