mirror of
https://github.com/discourse/discourse.git
synced 2024-12-17 12:05:58 +08:00
2f2da72747
Our 'page_view_crawler' / 'page_view_anon' metrics are based purely on the User Agent sent by clients. This means that 'badly behaved' bots which are imitating real user agents are counted towards 'anon' page views. This commit introduces a new method of tracking visitors. When an initial HTML request is made, we assume it is a 'non-browser' request (i.e. a bot). Then, once the JS application has booted, we notify the server to count it as a 'browser' request. This reliance on a JavaScript-capable browser matches up more closely to dedicated analytics systems like Google Analytics. Existing data collection and graphs are unchanged. Data collected via the new technique is available in a new 'experimental' report.
19 lines
568 B
Plaintext
19 lines
568 B
Plaintext
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title><%= @topic.title %> - <%= SiteSetting.title %></title>
|
|
<%= render partial: "layouts/head" %>
|
|
<%= render partial: "common/discourse_publish_stylesheet" %>
|
|
<%= render_google_tag_manager_head_code %>
|
|
<%= render_google_universal_analytics_code %>
|
|
<%= preload_script 'publish' %>
|
|
<%= preload_script 'pageview' %>
|
|
</head>
|
|
<body class="<%= @body_classes.to_a.join(' ') %>">
|
|
<%= theme_lookup("header") %>
|
|
<%= yield %>
|
|
<%= theme_lookup("footer") %>
|
|
</body>
|
|
</html>
|