> For the complete documentation index, see [llms.txt](https://docs.uxwizz.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.uxwizz.com/guides/technical-details/ip-geolocation.md).

# IP Geolocation

The **Country** and optional **City** of each recorded user session is stored in the database and displayed in the dashboard.

The geolocation is done based on user IP using the freely available IP geolocation database provided by [https://db-ip.com](https://db-ip.com/).

To switch between **Country** and **City** level tracking go to Settings->Tracking settings and click "Download city geoip database" (or "Disable" to delete it):

![](/files/j2rSZe0XnnYgIkFmxfxH)

{% hint style="info" %}
UXWizz automatically detects whether a **city database** is present or not and will use it for newly tracked sessions.
{% endhint %}

### Manually uploading an IP geolocation database

#### Country-level geolocation:

If no city database is present, the default country one will be used **ip-database.mmdb**

{% hint style="warning" %}
The default **ip-database.mmdb** database will be overwritten automatically every time you update to a new UXWizz version.
{% endhint %}

#### To enable city-level geolocation:

* Upload an IP geolocation database file named **ip-database-city.mmdb** to your UXWizz server inside the **/server/helpers/geolocation/** folder

  I recommend the [City Lite Free DB from db-ip.com](https://db-ip.com/db/download/ip-to-city-lite).&#x20;
* Download the **mmdb** file (extract it if the extension is **.gz**)
* Rename it to **ip-database-city.mmdb**&#x20;
* Place it inside the **/server/helpers/geolocation/** folder.

{% hint style="warning" %}
An Apache server restart might be needed for PHP to detect the new file.
{% endhint %}

To disable city-level geolocation rename or remove the `ip-database-city.mmdb`.

### Increasing the accuracy of IP geolocation

IP geolocation is in general only an approximation and not extremely accurate. One way to increase the accuracy is to purchase a more accurate database like the [DB-IP Location](https://db-ip.com/db/ip-to-location) one and preferably update every few months to the latest version.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.uxwizz.com/guides/technical-details/ip-geolocation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
