Understand IP address and location properties

  • Updated

This article will help you:

  • Understand Amplitude defines and uses location properties to enhance your analyses 
  • Understand how Amplitude tracks location properties when IP addresses are blocked or filtered out

Data that highlights user location properties, such as a user's city and country, are crucial for generating insights related to the geographical distribution of your users. They can show you how user preferences and behaviors differ from region to region, and help you better optimize your product.

How Amplitude tracks location properties

Amplitude uses the MaxMind database to look up location information from the user's IP address. Even though MaxMind data is generally highly reliable, the accuracy and availability of city and region information can vary by country.

By default, Amplitude uses the GeoIP to gather location property values based on location_lat and location_long. You may explicitly define how a user's location properties will be tracked server-side. Amplitude's HTTP API allows you to send your own amplitude_logo.png Cityamplitude_logo.png DMAamplitude_logo.png Region, and amplitude_logo.png Country values with your events.

NOTE: If you choose to send these values, Amplitude will not modify them to reflect GeoIP. Always update all four fields together, as setting any one of the fields will automatically reset the others.

How Amplitude determines location properties when IP address is blocked or filtered out

Even if you have chosen to block or filter IP addresses in your data ingestion, Amplitude will still use the IP address to determine location properties. The following steps outline how this works in the backend:

  1. An event is uploaded with an IP address.
  2. Amplitude uses the IP address to determine the location data, and adds all the relevant fields to the event.
  3. The system looks at the tracking options and filters for the project, excluding blocked or filtered fields as applicable.
  4. When you look at this specific event in Amplitude, it will not have an associated IP address. However, it will have related location properties, such as city and country.

NOTE: Any IP address currently known for a user will be synced to all future events by default. To change it, you can unset the IP address with the identify API.

If you are using an SDK and want Amplitude to drop IP addresses, please configure the options within the SDK. If you want to remove IP addresses on events moving forward, please file a Service Task request on the Support form.