From 6532962c1c25fac90b7390fe495745d2147c20c8 Mon Sep 17 00:00:00 2001 From: maxwell Date: Tue, 29 Jun 2010 13:58:36 -0700 Subject: [PATCH] trying to get google analytics working --- app/views/layouts/application.html.haml | 14 ++++++++++++-- public/javascripts/google.js | 10 ---------- 2 files changed, 12 insertions(+), 12 deletions(-) delete mode 100644 public/javascripts/google.js diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 745f9ae23..ebfc78da6 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -9,10 +9,20 @@ = stylesheet_link_tag "blueprint/screen", :media => 'screen' = stylesheet_link_tag "application" /= javascript_include_tag"http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" - = javascript_include_tag 'jquery142', 'rails', 'view', 'google' + = javascript_include_tag 'jquery142', 'rails', 'view' = javascript_include_tag 'tiny_mce/tiny_mce.js' + :javascript + var _gaq = _gaq || []; + _gaq.push(['_setAccount', 'UA-17207587-1']); + _gaq.push(['_setDomainName', '#{root_url}']); + _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); + })(); - - unless request.user_agent.include? "Safari" ||"Chrome" = javascript_include_tag 'FABridge', 'swfobject', 'web_socket' :javascript diff --git a/public/javascripts/google.js b/public/javascripts/google.js deleted file mode 100644 index 3c01e09b6..000000000 --- a/public/javascripts/google.js +++ /dev/null @@ -1,10 +0,0 @@ - var _gaq = _gaq || []; - _gaq.push(['_setAccount', 'UA-17207587-1']); - _gaq.push(['_setDomainName', '.joindiaspora.com']); - _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); - })();