Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

use async clicky tracking code

  • Loading branch information...
commit f8e68a51ec1d9806128d16908675f5c4452c8966 1 parent 2991dbf
@bobthecow authored
Showing with 22 additions and 16 deletions.
  1. +10 −4 config.yaml
  2. +12 −12 layouts/{default.html → default.erb}
View
14 config.yaml
@@ -1,15 +1,15 @@
text_extensions: [ 'css', 'erb', 'haml', 'htm', 'html', 'js', 'less', 'markdown', 'md', 'php', 'rb', 'sass', 'scss', 'txt', 'xhtml', 'xml' ]
-output_dir: output
+output_dir: output
index_filenames: [ 'index.html' ]
enable_output_diff: true
data_sources:
- - type: filesystem_unified
- items_root: /
+ - type: filesystem_unified
+ items_root: /
layouts_root: /
watcher:
- dirs_to_watch: [ 'content', 'layouts', 'lib' ]
+ dirs_to_watch: [ 'content', 'layouts', 'lib' ]
files_to_watch: [ 'config.yaml', 'Rules' ]
notify_on_compilation_success: true
notify_on_compilation_failure: true
@@ -17,3 +17,9 @@ watcher:
prune:
auto_prune: false
exclude: [ '.git' ]
+
+google_analytics:
+ site_id: UA-719239-21
+
+clicky:
+ site_id: 66493146
View
24 layouts/default.html → layouts/default.erb
@@ -55,18 +55,18 @@
</footer>
<script src="/script.js"></script>
<script type="text/javascript">
- var _gaq = _gaq || [];
- _gaq.push(['_setAccount', 'UA-719239-21']);
- _gaq.push(['_trackPageview']);
-
- (function() {
- var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
- })();
+ var _gaq = [['_setAccount', '<%= @config[:google_analytics][:site_id] %>'], ['_trackPageview']];
+ var clicky_site_ids = [<%= @config[:clicky][:site_id] %>];
+ (function(d, t, gs, cs) {
+ var g = d.createElement(t); g.async = true; g.src = gs;
+ var c = d.createElement(t); c.async = true; c.src = cs;
+ var s = d.getElementsByTagName(t)[0];
+ s.parentNode.insertBefore(g, s);
+ s.parentNode.insertBefore(c, s);
+ })(document, 'script',
+ ('https:' == location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js',
+ ('https:' == location.protocol ? 'https://' : 'http://') + 'static.getclicky.com/js');
</script>
- <script src="//static.getclicky.com/js" type="text/javascript"></script>
- <script type="text/javascript">try{ clicky.init(66493146); }catch(e){}</script>
- <noscript><p><img alt="" width="1" height="1" src="//in.getclicky.com/66493146ns.gif" /></p></noscript>
+ <noscript><img alt="" width="1" height="1" src="http://in.getclicky.com/<%= @config[:clicky][:site_id] %>ns.gif" /></noscript>
</body>
</html>
Please sign in to comment.
Something went wrong with that request. Please try again.