Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.
TypeScript analyticsanalytics-dashboardclickhouseelixirgoogle-analyticsmarketingopen-source-analyticsphoenixplausible-analyticspostgresqlprivacyprivacy-friendlyself-hostedsimple-analyticsstatisticstailwindcssweb-analyticswebsite-analyticswebsite-statswebsite-tracking
Fix tracker plug configuration
Uku Taht7685239204cc
diff --git a/lib/plausible_web/plugs/tracker.ex b/lib/plausible_web/plugs/tracker.exindex 29b54a9907..982f30869f 100644--- a/lib/plausible_web/plugs/tracker.ex+++ b/lib/plausible_web/plugs/tracker.ex@@ -1,5 +1,6 @@defmodule PlausibleWeb.Tracker doimport Plug.Conn+ use Agent@templates ["plausible.js",@@ -20,9 +21,7 @@ defmodule PlausibleWeb.Tracker dotemplates =Enum.reduce(@templates, %{}, fn template_filename, rendered_templates ->rendered =- EEx.eval_file("priv/tracker/js/" <> template_filename,- base_url: PlausibleWeb.Endpoint.url()- )+ EEx.compile_file("priv/tracker/js/" <> template_filename)aliases = Map.get(@aliases, template_filename, [])@@ -37,8 +36,10 @@ defmodule PlausibleWeb.Tracker dodef call(conn, templates: templates) docase templates[conn.request_path] do- found when is_binary(found) -> send_js(conn, found)nil -> conn+ found ->+ {js, _} = Code.eval_quoted(found, base_url: PlausibleWeb.Endpoint.url())+ send_js(conn, js)endend