Skip to content

Ignore unknown countries - #2556

Merged
vinibrsl merged 6 commits into
masterfrom
ignore-unknown-locations
Jan 3, 2023
Merged

Ignore unknown countries#2556
vinibrsl merged 6 commits into
masterfrom
ignore-unknown-locations

Conversation

@ukutaht

@ukutaht ukutaht commented Jan 3, 2023

Copy link
Copy Markdown
Contributor

Changes

There are some country codes we're recording that cannot be displayed. These are not real countries they are:
XX - disputed territory (https://sentry.plausible.io/organizations/sentry/issues/1095/events/b01fa99ae92f4712ba3579371416be39/?environment=prod&project=1)
T1 - Tor exit node (https://sentry.plausible.io/organizations/sentry/issues/1095/events/af5adb05fb79486d9e90f48cf3707be6/?environment=prod&project=1)

Also makes the following changes:

  • Do not attempt to look up region and city codes if country is unknown
  • Extracts geolocation to a dedicated module

Tests

  • Automated tests have been added

Changelog

  • Changelog has been updated

Documentation

  • This change does not need a documentation update

Dark mode

  • This PR does not change the UI

@bundlemon

bundlemon Bot commented Jan 3, 2023

Copy link
Copy Markdown

BundleMon

Unchanged files (7)
Status Path Size Limits
static/css/app.css
515.19KB -
static/js/dashboard.js
297.45KB -
static/js/app.js
12.13KB -
static/js/embed.host.js
5.58KB -
static/js/embed.content.js
5.06KB -
tracker/js/plausible.js
748B -
static/js/applyTheme.js
314B -

No change in files bundle size

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

@ukutaht
ukutaht requested a review from a team January 3, 2023 11:11
@ukutaht ukutaht changed the title Ignore unknown locations Ignore unknown countries Jan 3, 2023
Comment thread lib/plausible/ingestion/geolocation.ex Outdated
@vinibrsl
vinibrsl merged commit 1785653 into master Jan 3, 2023
@vinibrsl
vinibrsl deleted the ignore-unknown-locations branch January 3, 2023 13:35
aerosol pushed a commit that referenced this pull request Jan 4, 2023
* Ignore XX and T1 countries

* Add fallback if country_code=nil

* Lookup city overrides directly in CityOverrides module

* Changelog

* Add empty moduledoc

* Remove redundant comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants