diff --git a/src/analytics/index.tsx b/src/analytics/index.tsx index 07af41473e..ac1c96e629 100644 --- a/src/analytics/index.tsx +++ b/src/analytics/index.tsx @@ -117,6 +117,7 @@ const Context = createContext({ geolocation: device.get(['geolocationServiceResponse']) || { countryCode: '', regionCode: '', + city: '', }, }, }) @@ -181,6 +182,7 @@ export function AnalyticsContext({ } const deviceId = useDeviceId() ?? 'unknown' const sessionId = useSessionId() + // only IP based, never GPS const geolocation = useGeolocationServiceResponse() const parentContext = useContext(Context) /* diff --git a/src/geolocation/const.ts b/src/geolocation/const.ts index 653e829bad..ea44e19d7e 100644 --- a/src/geolocation/const.ts +++ b/src/geolocation/const.ts @@ -9,4 +9,5 @@ export const GEOLOCATION_SERVICE_URL = `${GEOLOCATION_URL}/geolocation` export const FALLBACK_GEOLOCATION_SERVICE_RESPONSE: Geolocation = { countryCode: undefined, regionCode: undefined, + city: undefined, } diff --git a/src/geolocation/types.ts b/src/geolocation/types.ts index 979b4dd742..b496fe4917 100644 --- a/src/geolocation/types.ts +++ b/src/geolocation/types.ts @@ -1,6 +1,8 @@ export type Geolocation = { countryCode: string | undefined regionCode: string | undefined + /** Only populated by the IP-based geolocation service. */ + city?: string serviceGeolocation?: Geolocation deviceGeolocation?: Geolocation }