Skip to content

Commit

Permalink
Apply filter when querying imported 404 events
Browse files Browse the repository at this point in the history
  • Loading branch information
zoldar committed May 14, 2024
1 parent 47f2081 commit 519a41e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/plausible/stats/imported.ex
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,15 @@ defmodule Plausible.Stats.Imported do
where(q, [i], i.name == ^event_name)
end

defp maybe_apply_filter(
q,
%{"event:goal" => {:is, {:event, "404"}}},
"event:props:path",
_dim
) do
where(q, [i], i.name == "404")
end

defp maybe_apply_filter(q, filters, property, dim) do
case filters[property] do
{:member, list} -> where(q, [i], field(i, ^dim) in ^list)
Expand Down

0 comments on commit 519a41e

Please sign in to comment.