Let staging track itself

This commit is contained in:
Uku Taht 2021-11-18 11:18:04 +02:00
parent 6b55ace014
commit a3aede73f9

View File

@ -1,10 +1,17 @@
<%= if Application.get_env(:plausible, :environment) == "prod" && !Application.get_env(:plausible, :is_selfhost) && !@conn.assigns[:skip_plausible_tracking] do %>
<script defer src="https://testing-plausible-io-proxy.uku-taht.workers.dev/js/script.js"></script>
<script defer src="<%="#{plausible_url()}/js/script.js"%>"></script>
<script>window.plausible = window.plausible || function() { (window.plausible.q = window.plausible.q || []).push(arguments) }</script>
<% end %>
<%= if !Application.get_env(:plausible, :is_selfhost) && !@conn.assigns[:skip_plausible_tracking] do %>
<%= if Application.get_env(:plausible, :environment) == "prod" do %>
<script defer src="https://testing-plausible-io-proxy.uku-taht.workers.dev/js/script.js"></script>
<script defer src="<%="#{plausible_url()}/js/script.js"%>"></script>
<script>window.plausible = window.plausible || function() { (window.plausible.q = window.plausible.q || []).push(arguments) }</script>
<% end %>
<%= if Application.get_env(:plausible, :environment) == "dev" do %>
<script defer src="<%="#{plausible_url()}/js/plausible.local.js"%>"></script>
<script>window.plausible = window.plausible || function() { (window.plausible.q = window.plausible.q || []).push(arguments) }</script>
<%= if Application.get_env(:plausible, :environment) == "staging" do %>
<script defer src="<%="#{plausible_url()}/js/plausible.js"%>"></script>
<script>window.plausible = window.plausible || function() { (window.plausible.q = window.plausible.q || []).push(arguments) }</script>
<% end %>
<%= if Application.get_env(:plausible, :environment) == "dev" do %>
<script defer src="<%="#{plausible_url()}/js/plausible.local.js"%>"></script>
<script>window.plausible = window.plausible || function() { (window.plausible.q = window.plausible.q || []).push(arguments) }</script>
<% end %>
<% end %>