From 7139ab742927a20e6e3360a2228a802892917819 Mon Sep 17 00:00:00 2001 From: yafeilee Date: Mon, 25 Apr 2016 11:34:36 +0800 Subject: [PATCH] Remove layout ga --- app/assets/javascripts/google_anlytics.js.coffee.erb | 2 +- app/views/layouts/_google_analytics.html.slim | 11 ----------- app/views/layouts/application.html.slim | 2 -- 3 files changed, 1 insertion(+), 14 deletions(-) delete mode 100644 app/views/layouts/_google_analytics.html.slim diff --git a/app/assets/javascripts/google_anlytics.js.coffee.erb b/app/assets/javascripts/google_anlytics.js.coffee.erb index d4f7069..6276cc2 100644 --- a/app/assets/javascripts/google_anlytics.js.coffee.erb +++ b/app/assets/javascripts/google_anlytics.js.coffee.erb @@ -37,6 +37,6 @@ class @GoogleAnalytics @analyticsId: -> '<%= ENV['GOOGLE'] %>' -<%- if ENV['GOOGLE'] %> +<% if ENV['GOOGLE'] %> GoogleAnalytics.load() <% end %> diff --git a/app/views/layouts/_google_analytics.html.slim b/app/views/layouts/_google_analytics.html.slim deleted file mode 100644 index 31028d7..0000000 --- a/app/views/layouts/_google_analytics.html.slim +++ /dev/null @@ -1,11 +0,0 @@ -- if ENV['GOOGLE'].present? - javascript: - var _gaq = _gaq || []; - _gaq.push(['_setAccount', '#{ENV['GOOGLE']}']); - _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); - })(); diff --git a/app/views/layouts/application.html.slim b/app/views/layouts/application.html.slim index b963ea4..1433b14 100644 --- a/app/views/layouts/application.html.slim +++ b/app/views/layouts/application.html.slim @@ -62,5 +62,3 @@ html = render 'common/welcome_new_year' = yield = render "layouts/footer" - - = render 'layouts/google_analytics'