diff --git a/app/views/common/_google_analytics.html.erb b/app/views/common/_google_analytics.html.erb index 30910978f4f..a3f9beac323 100644 --- a/app/views/common/_google_analytics.html.erb +++ b/app/views/common/_google_analytics.html.erb @@ -4,7 +4,7 @@ _gaq.push(['_setAccount', '<%= SiteSetting.ga_tracking_code %>']); <% if SiteSetting.ga_domain_name.present? %> - _gaq.push(['_setDomainName', '<%= SiteSetting.ga_domain_name %>']); + _gaq.push(['_setDomainName', '<%= SiteSetting.ga_domain_name.gsub(/^http(s)?:\/\//, '') %>']); <% end %> _gaq.push(['_setCustomVar', 1, 'Anonymous', <%= !current_user %>, 2]);