Add city to IP-based geo (#11603)
This commit is contained in:
@@ -117,6 +117,7 @@ const Context = createContext<AnalyticsBaseContextType>({
|
||||
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)
|
||||
/*
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user