Skip to content

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

Remove query against `new_visitor`

Uku Taht4f1ec6a2c24e
diff --git a/lib/plausible/stats/stats.ex b/lib/plausible/stats/stats.ex
index f859252846..0011acb088 100644
--- a/lib/plausible/stats/stats.ex
+++ b/lib/plausible/stats/stats.ex
@@ -219,8 +219,7 @@ defmodule Plausible.Stats do
def visitors_from_referrer(site, query, referrer) do
Repo.one(
from e in base_query(site, query),
- select: count(e),
- where: e.new_visitor,
+ select: count(e.user_id, :distinct),
where: e.referrer_source == ^referrer
)
end