mirror of
https://github.com/plausible/analytics.git
synced 2024-12-29 20:42:01 +03:00
257fa16cdc
* Simplify Phoenix error template * Test tracking script is not included in error pages * Test tracking script is not rendered in error templates * Rename error layout and remove unnecessary HTML boilerplate * Add layout setting to errors rendered without exceptions * Add skip_plausible_tracking option to more pages
10 lines
868 B
Elixir
10 lines
868 B
Elixir
<%= if !Application.get_env(:plausible, :is_selfhost) && !@conn.assigns[:skip_plausible_tracking] do %>
|
|
<%= if Application.get_env(:plausible, :environment) in ["prod", "staging"] do %>
|
|
<script defer data-domain="<%= base_domain() %>" event-logged_in="<%= !!@conn.assigns[:current_user] %>" src="<%="#{plausible_url()}/js/script.pageview-props.js"%>"></script>
|
|
<script>window.plausible = window.plausible || function() { (window.plausible.q = window.plausible.q || []).push(arguments) }</script>
|
|
<% else %>
|
|
<script defer data-domain="<%= base_domain() %>" event-logged_in="<%= !!@conn.assigns[:current_user] %>" src="<%="#{plausible_url()}/js/plausible.local.pageview-props.js"%>"></script>
|
|
<script>window.plausible = window.plausible || function() { (window.plausible.q = window.plausible.q || []).push(arguments) }</script>
|
|
<% end %>
|
|
<% end %>
|