From ec9aeab275f199a104a9d48b4a190ac5b507e615 Mon Sep 17 00:00:00 2001 From: davidtsadler Date: Fri, 30 Dec 2011 23:11:43 +0000 Subject: Add google analytics. --- _config.yml.example | 8 ++++++++ _site_build/_includes/google_analytics.html | 6 ++++++ _site_build/_layouts/default.html | 3 +++ 3 files changed, 17 insertions(+) create mode 100644 _site_build/_includes/google_analytics.html diff --git a/_config.yml.example b/_config.yml.example index 89bd20f..75621c6 100644 --- a/_config.yml.example +++ b/_config.yml.example @@ -4,23 +4,31 @@ # Appears in the and <header> elements within the site. title: + # Optional. Appears in the site's main <header> element. #subtitle: + # Used in various places where the author of the site needs to appear. # For example, the copyright notice. author: # Optional information that appears in the 'Contact' sidebar. # Mainly used to generate URLs to various social sites. + # email address of the site author. #email: + # Twitter name minus the @ character. #twitter: + # Git hub name. #github: + # Controls the number of recent posts shown on the main index page. max_recent_posts: 10 +# Optional Google analytics. +#google_ua: # *************************** # JEKYLL CONFIG diff --git a/_site_build/_includes/google_analytics.html b/_site_build/_includes/google_analytics.html new file mode 100644 index 0000000..1af92a9 --- /dev/null +++ b/_site_build/_includes/google_analytics.html @@ -0,0 +1,6 @@ +<script> + window._gaq = [['_setAccount','{{ site.google_ua }}'],['_trackPageview'],['_trackPageLoadTime']]; + Modernizr.load({ + load: ('https:' == location.protocol ? '//ssl' : '//www') + '.google-analytics.com/ga.js' + }); +</script> diff --git a/_site_build/_layouts/default.html b/_site_build/_layouts/default.html index b27e119..4eaed35 100644 --- a/_site_build/_layouts/default.html +++ b/_site_build/_layouts/default.html @@ -28,4 +28,7 @@ </div> </div> </body> +{% if site.google_ua %} + {% include google_analytics.html %} +{% endif %} </html> -- cgit v1.2.3-13-gbd6f