mirror of
https://github.com/plausible/analytics.git
synced 2024-12-24 01:54:34 +03:00
Do not return prop names when they are not used
This commit is contained in:
parent
f42f4da44b
commit
5be38a57fa
@ -23,10 +23,6 @@ defmodule Plausible.Stats.Props do
|
||||
end)
|
||||
end
|
||||
else
|
||||
query =
|
||||
Plausible.Stats.Query.remove_goal(query)
|
||||
|> Plausible.Stats.Query.put_filter("event:name", nil)
|
||||
|
||||
ClickhouseRepo.all(
|
||||
from e in base_event_query(site, query),
|
||||
inner_lateral_join: meta in fragment("meta as m"),
|
||||
|
@ -508,7 +508,12 @@ defmodule PlausibleWeb.Api.StatsController do
|
||||
|
||||
%{"visitors" => %{"value" => total_visitors}} = Stats.aggregate(site, total_q, ["visitors"])
|
||||
|
||||
prop_names = Stats.props(site, query)
|
||||
prop_names =
|
||||
if query.filters["event:goal"] do
|
||||
Stats.props(site, query)
|
||||
else
|
||||
%{}
|
||||
end
|
||||
|
||||
conversions =
|
||||
Stats.breakdown(site, query, "event:goal", ["visitors", "events"], {100, 1})
|
||||
|
@ -37,7 +37,7 @@ defmodule PlausibleWeb.Api.StatsController.ConversionsTest do
|
||||
"name" => "Signup",
|
||||
"count" => 2,
|
||||
"total_count" => 3,
|
||||
"prop_names" => ["variant"],
|
||||
"prop_names" => nil,
|
||||
"conversion_rate" => 50
|
||||
},
|
||||
%{
|
||||
|
Loading…
Reference in New Issue
Block a user