diff --git a/CHANGELOG.md b/CHANGELOG.md index c7e7673b20ff..8c96ea0b70da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file. - UTM Medium report and API shows (gclid) and (msclkid) for paid searches when no explicit utm medium present. - Support for `case_sensitive: false` modifiers in Stats API V2 filters for case-insensitive searches. - Add text version to emails plausible/analytics#4674 +- Add acquisition channels report ### Removed diff --git a/assets/js/dashboard/stats/sources/source-list.js b/assets/js/dashboard/stats/sources/source-list.js index 24c810be269a..cacc7758033d 100644 --- a/assets/js/dashboard/stats/sources/source-list.js +++ b/assets/js/dashboard/stats/sources/source-list.js @@ -197,9 +197,7 @@ export default function SourceList() { return (
- {site.flags.channels && -
Channels
- } +
Channels
Sources
diff --git a/lib/plausible_web/controllers/stats_controller.ex b/lib/plausible_web/controllers/stats_controller.ex index 686567336fa0..e4c2aceec39f 100644 --- a/lib/plausible_web/controllers/stats_controller.ex +++ b/lib/plausible_web/controllers/stats_controller.ex @@ -121,6 +121,7 @@ defmodule PlausibleWeb.StatsController do csvs = %{ ~c"visitors.csv" => fn -> main_graph_csv(site, query, conn.assigns[:current_user]) end, ~c"sources.csv" => fn -> Api.StatsController.sources(conn, params) end, + ~c"channels.csv" => fn -> Api.StatsController.channels(conn, params) end, ~c"utm_mediums.csv" => fn -> Api.StatsController.utm_mediums(conn, params) end, ~c"utm_sources.csv" => fn -> Api.StatsController.utm_sources(conn, params) end, ~c"utm_campaigns.csv" => fn -> Api.StatsController.utm_campaigns(conn, params) end, @@ -144,15 +145,6 @@ defmodule PlausibleWeb.StatsController do ~c"custom_props.csv" => fn -> Api.StatsController.all_custom_prop_values(conn, params) end } - # credo:disable-for-lines:7 - csvs = - if FunWithFlags.enabled?(:channels, for: site) || - FunWithFlags.enabled?(:channels, for: conn.assigns[:current_user]) do - Map.put(csvs, ~c"channels.csv", fn -> Api.StatsController.channels(conn, params) end) - else - csvs - end - csv_values = Map.values(csvs) |> Plausible.ClickhouseRepo.parallel_tasks() @@ -382,7 +374,7 @@ defmodule PlausibleWeb.StatsController do defp get_flags(user, site), do: - [:channels, :saved_segments, :scroll_depth] + [:saved_segments, :scroll_depth] |> Enum.map(fn flag -> {flag, FunWithFlags.enabled?(flag, for: user) || FunWithFlags.enabled?(flag, for: site)} end)