diff --git a/lib/plausible/funnels.ex b/lib/plausible/funnels.ex index d1df1d104..8b229555e 100644 --- a/lib/plausible/funnels.ex +++ b/lib/plausible/funnels.ex @@ -29,8 +29,10 @@ defmodule Plausible.Funnels do def list(%Plausible.Site{id: site_id}) do Repo.all( from(f in Funnel, + inner_join: steps in assoc(f, :steps), where: f.site_id == ^site_id, - select: %{name: f.name, id: f.id}, + select: %{name: f.name, id: f.id, steps_count: count(steps)}, + group_by: f.id, order_by: [desc: :id] ) ) diff --git a/lib/plausible_web/live/funnel_settings/list.ex b/lib/plausible_web/live/funnel_settings/list.ex index 08f4bb8a4..4f1f5fc80 100644 --- a/lib/plausible_web/live/funnel_settings/list.ex +++ b/lib/plausible_web/live/funnel_settings/list.ex @@ -11,6 +11,10 @@ defmodule PlausibleWeb.Live.FunnelSettings.List do
<%= funnel.name %> +
+ + <%= funnel.steps_count %>-step funnel +
<%= button(to: "", method: :delete, class: "text-sm text-red-600", data: [confirm: "Are you sure you want to remove funnel '#{funnel.name}'? This will just affect the UI, all of your analytics data will stay intact."]) do %>