mirror of
https://github.com/plausible/analytics.git
synced 2024-11-23 11:12:15 +03:00
Remove pageview filter by default
This commit is contained in:
parent
a3aede73f9
commit
e355828465
@ -60,12 +60,6 @@ defmodule Plausible.Stats.Filters do
|
||||
end
|
||||
end)
|
||||
|
||||
new_filters =
|
||||
case new_filters["event:goal"] do
|
||||
nil -> Map.put(new_filters, "event:name", {:is, "pageview"})
|
||||
_ -> new_filters
|
||||
end
|
||||
|
||||
%Plausible.Stats.Query{query | filters: new_filters}
|
||||
end
|
||||
|
||||
|
@ -192,7 +192,6 @@ defmodule Plausible.Stats.Query do
|
||||
query.filters
|
||||
|> Map.drop(props)
|
||||
|> Map.delete("event:goal")
|
||||
|> Map.put("event:name", {:is, "pageview"})
|
||||
|
||||
%__MODULE__{query | filters: new_filters}
|
||||
end
|
||||
|
@ -1,2 +1,2 @@
|
||||
name,conversions,conversion_rate
|
||||
,1,100.0
|
||||
,1,50.0
|
||||
|
|
@ -1,2 +1,2 @@
|
||||
name,conversions,conversion_rate
|
||||
,1,33.3
|
||||
,1,25.0
|
||||
|
|
@ -1,2 +1,2 @@
|
||||
name,conversions,conversion_rate
|
||||
/,1,33.3
|
||||
/,1,25.0
|
||||
|
|
@ -1,2 +1,2 @@
|
||||
name,conversions,conversion_rate
|
||||
/,1,50.0
|
||||
/,1,33.3
|
||||
|
|
@ -1,2 +1,2 @@
|
||||
name,conversions,conversion_rate
|
||||
,1,33.3
|
||||
,1,25.0
|
||||
|
|
@ -1,2 +1,2 @@
|
||||
name,conversions,conversion_rate
|
||||
/,1,33.3
|
||||
/,1,25.0
|
||||
|
|
@ -1,3 +1,3 @@
|
||||
name,visitors
|
||||
ABrowserName,2
|
||||
,1
|
||||
,2
|
||||
|
|
@ -1,2 +1,2 @@
|
||||
name,visitors
|
||||
,3
|
||||
,4
|
||||
|
|
@ -1,2 +1,2 @@
|
||||
name,unique_entrances,total_entrances,visit_duration
|
||||
/,3,3,20
|
||||
/,4,4,15
|
||||
|
|
@ -1,3 +1,3 @@
|
||||
name,unique_exits,total_exits,exit_rate
|
||||
/,2,2,66.0
|
||||
/,3,3,100.0
|
||||
/some-other-page,1,1,100.0
|
||||
|
|
@ -1,2 +1,2 @@
|
||||
name,visitors
|
||||
,3
|
||||
,4
|
||||
|
|
@ -1,3 +1,3 @@
|
||||
name,visitors,bounce_rate,time_on_page
|
||||
/,3,67,
|
||||
/,4,75,
|
||||
/some-other-page,1,,60.0
|
||||
|
|
@ -28,5 +28,5 @@ date,visitors,pageviews,bounce_rate,visit_duration
|
||||
2021-10-16,0,0,,
|
||||
2021-10-17,0,0,,
|
||||
2021-10-18,0,0,,
|
||||
2021-10-19,1,1,100,0
|
||||
2021-10-19,2,1,100,0
|
||||
2021-10-20,1,2,0,60
|
||||
|
|
@ -1,3 +1,3 @@
|
||||
name,visitors
|
||||
ABrowserName,3
|
||||
,1
|
||||
,2
|
||||
|
|
@ -1,2 +1,2 @@
|
||||
name,visitors
|
||||
,4
|
||||
,5
|
||||
|
|
@ -1,2 +1,2 @@
|
||||
name,unique_entrances,total_entrances,visit_duration
|
||||
/,4,4,15
|
||||
/,5,5,12
|
||||
|
|
@ -1,3 +1,3 @@
|
||||
name,unique_exits,total_exits,exit_rate
|
||||
/,3,3,75.0
|
||||
/,4,4,100.0
|
||||
/some-other-page,1,1,100.0
|
||||
|
|
@ -1,2 +1,2 @@
|
||||
name,visitors
|
||||
,4
|
||||
,5
|
||||
|
|
@ -1,3 +1,3 @@
|
||||
name,visitors,bounce_rate,time_on_page
|
||||
/,4,75,
|
||||
/,5,80,
|
||||
/some-other-page,1,,60.0
|
||||
|
|
@ -4,4 +4,4 @@ date,visitors,pageviews,bounce_rate,visit_duration
|
||||
2021-07-01,0,0,,
|
||||
2021-08-01,0,0,,
|
||||
2021-09-01,1,1,100,0
|
||||
2021-10-01,2,3,67,20
|
||||
2021-10-01,3,3,67,20
|
||||
|
|
@ -38,14 +38,14 @@ defmodule PlausibleWeb.Api.StatsController.ConversionsTest do
|
||||
"unique_conversions" => 2,
|
||||
"total_conversions" => 3,
|
||||
"prop_names" => nil,
|
||||
"conversion_rate" => 50
|
||||
"conversion_rate" => 33.3
|
||||
},
|
||||
%{
|
||||
"name" => "Visit /register",
|
||||
"unique_conversions" => 2,
|
||||
"total_conversions" => 2,
|
||||
"prop_names" => nil,
|
||||
"conversion_rate" => 50
|
||||
"conversion_rate" => 33.3
|
||||
}
|
||||
]
|
||||
end
|
||||
@ -81,7 +81,7 @@ defmodule PlausibleWeb.Api.StatsController.ConversionsTest do
|
||||
"unique_conversions" => 2,
|
||||
"total_conversions" => 2,
|
||||
"prop_names" => ["variant"],
|
||||
"conversion_rate" => 50
|
||||
"conversion_rate" => 33.3
|
||||
}
|
||||
]
|
||||
end
|
||||
@ -115,13 +115,13 @@ defmodule PlausibleWeb.Api.StatsController.ConversionsTest do
|
||||
"unique_conversions" => 2,
|
||||
"name" => "B",
|
||||
"total_conversions" => 2,
|
||||
"conversion_rate" => 66.7
|
||||
"conversion_rate" => 33.3
|
||||
},
|
||||
%{
|
||||
"unique_conversions" => 1,
|
||||
"name" => "A",
|
||||
"total_conversions" => 1,
|
||||
"conversion_rate" => 33.3
|
||||
"conversion_rate" => 16.7
|
||||
}
|
||||
]
|
||||
end
|
||||
@ -151,13 +151,13 @@ defmodule PlausibleWeb.Api.StatsController.ConversionsTest do
|
||||
"unique_conversions" => 2,
|
||||
"name" => "(none)",
|
||||
"total_conversions" => 2,
|
||||
"conversion_rate" => 66.7
|
||||
"conversion_rate" => 33.3
|
||||
},
|
||||
%{
|
||||
"unique_conversions" => 1,
|
||||
"name" => "A",
|
||||
"total_conversions" => 1,
|
||||
"conversion_rate" => 33.3
|
||||
"conversion_rate" => 16.7
|
||||
}
|
||||
]
|
||||
end
|
||||
|
@ -253,7 +253,7 @@ defmodule PlausibleWeb.Api.StatsController.MainGraphTest do
|
||||
)
|
||||
|
||||
res = json_response(conn, 200)
|
||||
assert %{"name" => "Unique visitors", "value" => 2, "change" => 100} in res["top_stats"]
|
||||
assert %{"name" => "Unique visitors", "value" => 3, "change" => 100} in res["top_stats"]
|
||||
end
|
||||
|
||||
test "returns converted visitors", %{conn: conn, site: site} do
|
||||
@ -294,7 +294,7 @@ defmodule PlausibleWeb.Api.StatsController.MainGraphTest do
|
||||
|
||||
res = json_response(conn, 200)
|
||||
|
||||
assert %{"name" => "Conversion rate", "value" => 50.0, "change" => 100} in res["top_stats"]
|
||||
assert %{"name" => "Conversion rate", "value" => 33.3, "change" => 100} in res["top_stats"]
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user