mirror of
https://github.com/plausible/analytics.git
synced 2024-12-23 17:44:43 +03:00
Ignore unknown country code (#2223)
* Ignore unknown country code * Add changelog entry
This commit is contained in:
parent
54260c294f
commit
b239f73a6d
@ -54,6 +54,7 @@ All notable changes to this project will be documented in this file.
|
||||
- Remove the `+ Add Site` link to the site-switcher dropdown in the dashboard.
|
||||
- `DISABLE_REGISTRATIONS` configuration parameter can now accept `invite_only` to allow invited users to register an account while keeping regular registrations disabled plausible/analytics#1841
|
||||
- New and improved Session tracking module for higher throughput and lower latency. [PR#1934](https://github.com/plausible/analytics#1934)
|
||||
- Do not display ZZ country code in countries report [PR#1934](https://github.com/plausible/analytics#2223)
|
||||
|
||||
## v1.4.1
|
||||
|
||||
|
@ -381,7 +381,7 @@ defmodule Plausible.Stats.Breakdown do
|
||||
defp do_group_by(q, "visit:country") do
|
||||
from(
|
||||
s in q,
|
||||
where: s.country_code != "\0\0",
|
||||
where: s.country_code != "\0\0" and s.country_code != "ZZ",
|
||||
group_by: s.country_code,
|
||||
select_merge: %{country: s.country_code}
|
||||
)
|
||||
|
@ -67,6 +67,14 @@ defmodule PlausibleWeb.Api.StatsController.CountriesTest do
|
||||
]
|
||||
end
|
||||
|
||||
test "ignores unknown country code ZZ", %{conn: conn, site: site} do
|
||||
populate_stats(site, [build(:pageview, country_code: "ZZ")])
|
||||
|
||||
conn = get(conn, "/api/stats/#{site.domain}/countries?period=day")
|
||||
|
||||
assert json_response(conn, 200) == []
|
||||
end
|
||||
|
||||
test "calculates conversion_rate when filtering for goal", %{conn: conn, site: site} do
|
||||
populate_stats(site, [
|
||||
build(:pageview,
|
||||
|
Loading…
Reference in New Issue
Block a user