Remove pageview filter by default

This commit is contained in:
Uku Taht 2021-11-22 10:42:51 +02:00
parent a3aede73f9
commit e355828465
24 changed files with 29 additions and 36 deletions

View File

@ -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

View File

@ -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

View File

@ -1,2 +1,2 @@
name,conversions,conversion_rate
,1,100.0
,1,50.0

1 name conversions conversion_rate
2 1 100.0 50.0

View File

@ -1,2 +1,2 @@
name,conversions,conversion_rate
,1,33.3
,1,25.0

1 name conversions conversion_rate
2 1 33.3 25.0

View File

@ -1,2 +1,2 @@
name,conversions,conversion_rate
/,1,33.3
/,1,25.0

1 name conversions conversion_rate
2 / 1 33.3 25.0

View File

@ -1,2 +1,2 @@
name,conversions,conversion_rate
/,1,50.0
/,1,33.3

1 name conversions conversion_rate
2 / 1 50.0 33.3

View File

@ -1,2 +1,2 @@
name,conversions,conversion_rate
,1,33.3
,1,25.0

1 name conversions conversion_rate
2 1 33.3 25.0

View File

@ -1,2 +1,2 @@
name,conversions,conversion_rate
/,1,33.3
/,1,25.0

1 name conversions conversion_rate
2 / 1 33.3 25.0

View File

@ -1,3 +1,3 @@
name,visitors
ABrowserName,2
,1
,2

1 name visitors
2 ABrowserName 2
3 1 2

View File

@ -1,2 +1,2 @@
name,visitors
,3
,4

1 name visitors
2 3 4

View File

@ -1,2 +1,2 @@
name,unique_entrances,total_entrances,visit_duration
/,3,3,20
/,4,4,15

1 name unique_entrances total_entrances visit_duration
2 / 3 4 3 4 20 15

View File

@ -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 name unique_exits total_exits exit_rate
2 / 2 3 2 3 66.0 100.0
3 /some-other-page 1 1 100.0

View File

@ -1,2 +1,2 @@
name,visitors
,3
,4

1 name visitors
2 3 4

View File

@ -1,3 +1,3 @@
name,visitors,bounce_rate,time_on_page
/,3,67,
/,4,75,
/some-other-page,1,,60.0

1 name visitors bounce_rate time_on_page
2 / 3 4 67 75
3 /some-other-page 1 60.0

View File

@ -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 date visitors pageviews bounce_rate visit_duration
28 2021-10-16 0 0
29 2021-10-17 0 0
30 2021-10-18 0 0
31 2021-10-19 1 2 1 100 0
32 2021-10-20 1 2 0 60

View File

@ -1,3 +1,3 @@
name,visitors
ABrowserName,3
,1
,2

1 name visitors
2 ABrowserName 3
3 1 2

View File

@ -1,2 +1,2 @@
name,visitors
,4
,5

1 name visitors
2 4 5

View File

@ -1,2 +1,2 @@
name,unique_entrances,total_entrances,visit_duration
/,4,4,15
/,5,5,12

1 name unique_entrances total_entrances visit_duration
2 / 4 5 4 5 15 12

View File

@ -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 name unique_exits total_exits exit_rate
2 / 3 4 3 4 75.0 100.0
3 /some-other-page 1 1 100.0

View File

@ -1,2 +1,2 @@
name,visitors
,4
,5

1 name visitors
2 4 5

View File

@ -1,3 +1,3 @@
name,visitors,bounce_rate,time_on_page
/,4,75,
/,5,80,
/some-other-page,1,,60.0

1 name visitors bounce_rate time_on_page
2 / 4 5 75 80
3 /some-other-page 1 60.0

View File

@ -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

1 date visitors pageviews bounce_rate visit_duration
4 2021-07-01 0 0
5 2021-08-01 0 0
6 2021-09-01 1 1 100 0
7 2021-10-01 2 3 3 67 20

View File

@ -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

View File

@ -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