mirror of
https://github.com/discourse/discourse.git
synced 2024-12-12 02:23:42 +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.
42 lines
1.5 KiB
Plaintext
42 lines
1.5 KiB
Plaintext
<% content_for :title do %><%= @page_title %> - <%= SiteSetting.title %><% end %>
|
|
|
|
<% content_for :head do %>
|
|
<meta id="discourse-error" data-discourse-error="true">
|
|
<% end %>
|
|
|
|
<% content_for :no_ember_head do %>
|
|
<meta id="discourse-error" data-discourse-error="true">
|
|
<% end %>
|
|
|
|
<div class="page-not-found">
|
|
<h1 class="title"><%= @title %></h1>
|
|
|
|
<%- if !@current_user %>
|
|
<a href="<%= path "/login" %>" class='btn btn-primary'><%= SvgSprite.raw_svg('fa-user') %><%= I18n.t('log_in') %></a>
|
|
<%- end %>
|
|
|
|
<%- if @group&.allow_membership_requests %>
|
|
<a href="<%= group_path @group.name %>" class='btn btn-primary'><%= SvgSprite.raw_svg('user-plus') %> <%= I18n.t('not_in_group.request_membership') %></a>
|
|
<%- elsif @group&.public_admission %>
|
|
<a href="<%= group_path @group.name %>" class='btn btn-primary'><%= SvgSprite.raw_svg('user-plus') %> <%= I18n.t('not_in_group.join_group') %></a>
|
|
<%- end %>
|
|
</div>
|
|
|
|
<%= build_plugin_html 'server:not-found-before-topics' %>
|
|
|
|
<%= @topics_partial %>
|
|
|
|
<%- unless @hide_search%>
|
|
<div class="row">
|
|
<div class="page-not-found-search">
|
|
<form action='<%= path "/search" %>' id='discourse-search'>
|
|
<label for="search-input"><%= t 'page_not_found.search_title' %></label>
|
|
<input type="text" id="search-input" name="q" value="<%= @slug %>">
|
|
<button class="btn btn-primary"><%= t 'page_not_found.search_button' %></button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<%= preload_script('onpopstate-handler') %>
|
|
<%- end %>
|