discourse/app/views/layouts/no_ember.html.erb
David Taylor 2f2da72747
FEATURE: Add experimental tracking of 'real browser' pageviews (#26647)
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.
2024-04-25 11:00:01 +01:00

54 lines
1.4 KiB
Plaintext

<!DOCTYPE html>
<html lang="<%= html_lang %>">
<head>
<meta charset="utf-8">
<title><%= content_for?(:title) ? yield(:title) : SiteSetting.title %></title>
<meta name="description" content="">
<%= render partial: "layouts/head" %>
<%= render partial: "common/discourse_stylesheet" %>
<%= discourse_csrf_tags %>
<%- unless customization_disabled? %>
<%= theme_lookup("head_tag") %>
<%- end %>
<%= yield(:no_ember_head) %>
<%- if allow_plugins? %>
<%= build_plugin_html 'server:before-head-close' %>
<%- end -%>
<%= preload_script "pageview" %>
</head>
<body class="no-ember <%= @custom_body_class %>">
<%- if allow_plugins? %>
<%= build_plugin_html 'server:after-body-open' %>
<%- end -%>
<%- unless customization_disabled? %>
<%= theme_lookup("header") %>
<%- end %>
<%- if allow_plugins? %>
<%= build_plugin_html 'server:header' %>
<%- end %>
<section id='main'>
<%= render partial: 'header', locals: { hide_auth_buttons: local_assigns[:hide_auth_buttons] } %>
<div id="main-outlet" class="<%= @container_class ? @container_class : 'wrap' %>">
<%= yield %>
</div>
</section>
<%- unless customization_disabled? %>
<%= theme_lookup("footer") %>
<%= theme_lookup("body_tag") %>
<%- end %>
<%- if allow_plugins? %>
<%= build_plugin_html 'no-client:footer' %>
<%= build_plugin_html 'server:before-body-close' %>
<%- end %>
</body>
</html>