mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 03:36:18 +08:00
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:
@ -5,12 +5,6 @@ module CommonHelper
|
|||||||
end
|
end
|
||||||
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
|
def render_google_tag_manager_code
|
||||||
if Rails.env.production? && SiteSetting.gtm_container_id.present?
|
if Rails.env.production? && SiteSetting.gtm_container_id.present?
|
||||||
render partial: "common/google_tag_manager"
|
render partial: "common/google_tag_manager"
|
||||||
|
@ -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>
|
|
@ -120,8 +120,6 @@
|
|||||||
|
|
||||||
<%= render :partial => "common/discourse_javascript" %>
|
<%= render :partial => "common/discourse_javascript" %>
|
||||||
|
|
||||||
<%= render_google_analytics_code %>
|
|
||||||
|
|
||||||
<%- unless customization_disabled? %>
|
<%- unless customization_disabled? %>
|
||||||
<%= raw theme_lookup("body_tag") %>
|
<%= raw theme_lookup("body_tag") %>
|
||||||
<%- end %>
|
<%- end %>
|
||||||
|
@ -32,7 +32,6 @@
|
|||||||
</nav>
|
</nav>
|
||||||
<p><%= t 'powered_by_html' %></p>
|
<p><%= t 'powered_by_html' %></p>
|
||||||
</footer>
|
</footer>
|
||||||
<%= render_google_analytics_code %>
|
|
||||||
<%= theme_lookup("body_tag") %>
|
<%= theme_lookup("body_tag") %>
|
||||||
</body>
|
</body>
|
||||||
<%= yield :after_body %>
|
<%= yield :after_body %>
|
||||||
|
@ -40,5 +40,3 @@
|
|||||||
});
|
});
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<%= render_google_analytics_code %>
|
|
||||||
|
@ -24,5 +24,3 @@
|
|||||||
<%- content_for(:head) do %>
|
<%- content_for(:head) do %>
|
||||||
<meta name="referrer" content="never">
|
<meta name="referrer" content="never">
|
||||||
<%- end %>
|
<%- end %>
|
||||||
|
|
||||||
<%= render_google_analytics_code %>
|
|
||||||
|
@ -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!"
|
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."
|
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"
|
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_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_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."
|
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."
|
||||||
|
@ -104,12 +104,6 @@ basic:
|
|||||||
ga_universal_auto_link_domains:
|
ga_universal_auto_link_domains:
|
||||||
default: ''
|
default: ''
|
||||||
type: list
|
type: list
|
||||||
ga_tracking_code:
|
|
||||||
client: true
|
|
||||||
default: ''
|
|
||||||
ga_domain_name:
|
|
||||||
client: true
|
|
||||||
default: ''
|
|
||||||
gtm_container_id:
|
gtm_container_id:
|
||||||
client: true
|
client: true
|
||||||
default: ''
|
default: ''
|
||||||
|
@ -10,8 +10,6 @@ Discourse.SiteSettingsOriginal = {
|
|||||||
"track_external_right_clicks":false,
|
"track_external_right_clicks":false,
|
||||||
"ga_universal_tracking_code":"",
|
"ga_universal_tracking_code":"",
|
||||||
"ga_universal_domain_name":"auto",
|
"ga_universal_domain_name":"auto",
|
||||||
"ga_tracking_code":"UA-33736483-2",
|
|
||||||
"ga_domain_name":"",
|
|
||||||
"top_menu":"latest|new|unread|categories|top",
|
"top_menu":"latest|new|unread|categories|top",
|
||||||
"post_menu":"like-count|like|share|flag|edit|bookmark|delete|admin|reply",
|
"post_menu":"like-count|like|share|flag|edit|bookmark|delete|admin|reply",
|
||||||
"post_menu_hidden_items":"flag|edit|delete|admin",
|
"post_menu_hidden_items":"flag|edit|delete|admin",
|
||||||
|
Reference in New Issue
Block a user