lib/jekyll-clicky/clicky.rb in jekyll-clicky-0.1.2 vs lib/jekyll-clicky/clicky.rb in jekyll-clicky-0.1.3
- old
+ new
@@ -29,12 +29,21 @@
@id = id
end
def code
<<-CODE
- <a title="Real Time Web Analytics" href="http://clicky.com/#{@id}"><img alt="Real Time Web Analytics" src="//static.getclicky.com/media/links/badge.gif" border="0" /></a>
- <script src="//static.getclicky.com/js" type="text/javascript"></script>
- <script type="text/javascript">try{ clicky.init(#{@id}); }catch(e){}</script>
- <noscript><p><img alt="Clicky" width="1" height="1" src="//in.getclicky.com/#{@id}ns.gif" /></p></noscript>
+<a title="Google Analytics Alternative" href="http://clicky.com/#{@id}"><img alt="Google Analytics Alternative" src="//static.getclicky.com/media/links/badge.gif" border="0" /></a>
+<script type="text/javascript">
+var clicky_site_ids = clicky_site_ids || [];
+clicky_site_ids.push(#{@id});
+(function() {
+ var s = document.createElement('script');
+ s.type = 'text/javascript';
+ s.async = true;
+ s.src = '//static.getclicky.com/js';
+ ( document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0] ).appendChild( s );
+})();
+</script>
+<noscript><p><img alt="Clicky" width="1" height="1" src="//in.getclicky.com/#{@id}ns.gif" /></p></noscript>
CODE
end
-end
\ No newline at end of file
+end