Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

Only include tracking module when mix env is prod

Uku Taht10f7beb1e056
diff --git a/lib/plausible_web/templates/layout/_tracking.html.eex b/lib/plausible_web/templates/layout/_tracking.html.eex
index 03b5884485..14b177d9e1 100644
--- a/lib/plausible_web/templates/layout/_tracking.html.eex
+++ b/lib/plausible_web/templates/layout/_tracking.html.eex
@@ -1,4 +1,4 @@
-<%= if [email protected][:skip_plausible_tracking] do %>
+<%= if Mix.env() == :prod && [email protected][:skip_plausible_tracking] do %>
<script async defer src="https://plausible.io/js/plausible.js"></script>
<script>window.plausible = window.plausible || function() { (window.plausible.q = window.plausible.q || []).push(arguments) }</script>
<% end %>