FEATURE: remove obsolete settings ga_tracking_code and ga_domain_name. Use ga_universal_tracking_code and ga_universal_domain_name instead.

This commit is contained in:
Neil Lalonde 2017-11-01 11:41:43 -04:00
parent 2792c3c80e
commit 7dc3671490
9 changed files with 0 additions and 41 deletions

View File

@ -5,12 +5,6 @@ module CommonHelper
end
end
def render_google_analytics_code
if Rails.env.production? && SiteSetting.ga_tracking_code.present?
render partial: "common/google_analytics"
end
end
def render_google_tag_manager_code
if Rails.env.production? && SiteSetting.gtm_container_id.present?
render partial: "common/google_tag_manager"

View File

@ -1,18 +0,0 @@
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '<%= SiteSetting.ga_tracking_code %>']);
<% if SiteSetting.ga_domain_name.present? %>
_gaq.push(['_setDomainName', '<%= SiteSetting.ga_domain_name.gsub(/^http(s)?:\/\//, '') %>']);
<% end %>
_gaq.push(['_setCustomVar', 1, 'Anonymous', <%= !current_user %>, 2]);
(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);
})();
</script>

View File

@ -120,8 +120,6 @@
<%= render :partial => "common/discourse_javascript" %>
<%= render_google_analytics_code %>
<%- unless customization_disabled? %>
<%= raw theme_lookup("body_tag") %>
<%- end %>

View File

@ -32,7 +32,6 @@
</nav>
<p><%= t 'powered_by_html' %></p>
</footer>
<%= render_google_analytics_code %>
<%= theme_lookup("body_tag") %>
</body>
<%= yield :after_body %>

View File

@ -40,5 +40,3 @@
});
})();
</script>
<%= render_google_analytics_code %>

View File

@ -24,5 +24,3 @@
<%- content_for(:head) do %>
<meta name="referrer" content="never">
<%- end %>
<%= render_google_analytics_code %>

View File

@ -1058,8 +1058,6 @@ en:
must_approve_users: "Staff must approve all new user accounts before they are allowed to access the site. WARNING: enabling this for a live site will revoke access for existing non-staff users!"
pending_users_reminder_delay: "Notify moderators if new users have been waiting for approval for longer than this many hours. Set to -1 to disable notifications."
maximum_session_age: "User will remain logged in for n hours since last visit"
ga_tracking_code: "OBSOLETE: Google analytics (ga.js) tracking code code, eg: UA-12345678-9; see http://google.com/analytics"
ga_domain_name: "OBSOLETE: Google analytics (ga.js) domain name, eg: mysite.com; see http://google.com/analytics"
ga_universal_tracking_code: "Google Universal Analytics (analytics.js) tracking code code, eg: UA-12345678-9; see http://google.com/analytics"
ga_universal_domain_name: "Google Universal Analytics (analytics.js) domain name, eg: mysite.com; see http://google.com/analytics"
ga_universal_auto_link_domains: "Enable Google Universal Analytics (analytics.js) cross-domain tracking. Outgoing links to these domains will have the client id added to them. See Google's Cross-Domain Tracking guide."

View File

@ -104,12 +104,6 @@ basic:
ga_universal_auto_link_domains:
default: ''
type: list
ga_tracking_code:
client: true
default: ''
ga_domain_name:
client: true
default: ''
gtm_container_id:
client: true
default: ''

View File

@ -10,8 +10,6 @@ Discourse.SiteSettingsOriginal = {
"track_external_right_clicks":false,
"ga_universal_tracking_code":"",
"ga_universal_domain_name":"auto",
"ga_tracking_code":"UA-33736483-2",
"ga_domain_name":"",
"top_menu":"latest|new|unread|categories|top",
"post_menu":"like-count|like|share|flag|edit|bookmark|delete|admin|reply",
"post_menu_hidden_items":"flag|edit|delete|admin",