Save city name when importing from GA (#2608)
This commit adds city data to imported records from Google Analytics. The current implementation sets city to 0 because GA does not use the GeoNames database. Google Analytics Reporting API uses [Geographical IDs](https://developers.google.com/analytics/devguides/collection/protocol/v1/geoid) to identify cities and countries. Plausible uses [GeoNames](https://geonames.org/) and I couldn't find databases corelating the two. Fortunately, GA also returns the city name and this commit uses the city name and the country ISO code to find the Geoname ID. To avoid making expensive ETS searches, I created another ETS table in the Location library that uses {country, city} as a key. Related PR: https://github.com/plausible/location/pull/3pull/2675/head r2023.02.14-55
parent
8fcf4d3304
commit
1cb07efe6d
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,9 @@
|
||||
defmodule Plausible.ClickhouseRepo.Migrations.RemoveCityNameToImportedLocations do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
alter table(:imported_locations) do
|
||||
remove :city_name
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Reference in New Issue