# Enrichment
The following table indicates whether each event property is **automatically collected** by the API and SDKs.
| Property | API | JavaScript SDK | Android/iOS SDK | Other SDKs |
|-------------------------------------------------------------------------|-------|----------------|-----------------|------------|
| `user` | ✓[^1] | ✓[^1] | ✓[^1] | ✓[^1] |
| `connectionId` | ✓[^2] | ✓[^1] | ✓[^1] | ✓[^1] |
| `anonymousId` | ✓[^2] | ✓ | ✓ | ✓[^2] |
| `channel` | | | | |
| `category` | | | | |
| [`context.app`](event-schema#app) | | | ✓ | |
| [`context.browser`](event-schema#browser) | | ✓[^1] | ✓[^1] | |
| [`context.campaign`](event-schema#campaign) | | ✓ | | |
| [`context.device`](event-schema#device) | | | ✓ | |
| `context.ip` - see [IP address](#ip-address) | ✓[^2] | ✓[^2] | ✓[^2] | ✓[^2] |
| [`context.library`](event-schema#library) | | ✓ | ✓ | ✓ |
| `context.locale` | | ✓ | ✓ | |
| [`context.location`](event-schema#location) - see [Location](#location) | | ✓[^2] | ✓[^2] | |
| [`context.network`](event-schema#network) | | ✓ | ✓ | |
| [`context.os`](event-schema#os) | | ✓[^1] | ✓[^1] | |
| [`context.page`](event-schema#page) | | ✓ | | |
| [`context.screen`](event-schema#screen) | | | ✓ | |
| [`context.session`](event-schema#session) | | ✓ | ✓ | |
| `context.timezone` | | ✓ | ✓ | |
| `context.userAgent` | | ✓ | ✓ | |
| `event` | | | | |
| `groupId` | | | | |
| `messageId` | ✓[^2] | ✓ | ✓ | ✓ |
| `name` | | | | |
| `properties` | | | | |
| `receivedAt` | ✓[^1] | ✓[^1] | ✓[^1] | ✓[^1] |
| `sentAt` | ✓[^2] | ✓ | ✓ | ✓ |
| `originalTimestamp` | ✓[^2] | ✓[^2] | ✓[^2] | ✓[^2] |
| `timestamp` | ✓[^2] | ✓ | ✓ | ✓ |
| `traits` | | | | |
| `type` | | ✓ | ✓ | ✓ |
| `previuosId` | | | | |
| `userId` | | | | |
[^1]: Collected server side by Krenalis.
[^2]: Collected server side by Krenalis if not provided.
## IP address
When using the [JavaScript SDK](https://www.krenalis.com/docs/integrations/javascript-sdk.md), [Android SDK](https://www.krenalis.com/docs/integrations/android-sdk.md), or [iOS SDK](https://www.krenalis.com/docs/integrations/ios-sdk.md), the event's IP address is automatically derived from the HTTP request when not explicitly provided. The IP address is resolved as follows:
- If the [`context.ip`](https://www.krenalis.com/docs/collect-events/spec/schema.md#context) field is provided, that value is used
- Otherwise, if the request includes the `X-Forwarded-For` header, the IP address is taken from that header
- Otherwise, the client's IP address is used
- If the resulting value is invalid or cannot be parsed, the event is discarded
The resolved IP is stored in the [`context.ip`](https://www.krenalis.com/docs/collect-events/spec/schema.md#context) field.
When using a different SDK or sending events directly through the API, the IP address must be explicitly provided in the [`context.ip`](https://www.krenalis.com/docs/collect-events/spec/schema.md#context). Otherwise, the event will not include an IP address.
### Special IPs and privacy
All SDKs and applications support a set of special IP values that let you control how the event's IP address is determined or masked.
These values can be used either to adjust the default behavior or to respect user privacy when needed.
| Special IP | Description |
|-----------------|----------------------------------------------------------------------------------------------------------------------------------------------------|
| 255.255.255.255 | Uses the IP address from the HTTP request. |
| 255.255.255.0 | Mask the request IP with 255.255.255.0, setting the last segment to 0 (e.g., 192.168.45.32 → 192.168.45.0). Use this for partial anonymization. |
| 255.255.0.0 | Mask the request IP with 255.255.0.0, setting the last two segments to 0 (e.g., 192.168.45.32 → 192.168.0.0). Use this for stronger anonymization. |
| 0.0.0.0 | The event will not include an IP address. Use this when no IP is applicable or when it should not be associated for privacy reasons. |
## Location
Krenalis determines a user's approximate geographic location by using the IP address of their device. It then automatically populates [`context.location`](https://www.krenalis.com/docs/collect-events/spec/schema.md#location) with the following data:
* City
* Country
* Latitude
* Longitude
To enable this feature, you need to obtain the GeoIP database provided by MaxMind. This database contains the IP-to-location mappings required by Krenalis.
### Setup
1. Visit the [MaxMind](https://www.maxmind.com/) website and create an account.
2. Navigate to **GeoIP / GeoLite** → **Download Files** → **GeoLite City** and select **Download GZIP**.
3. Review the license included in the downloaded package.
4. Copy the `GeoLite2-City.mmdb` file to the server where Krenalis is running.
5. Set the `KRENALIS_MAXMIND_DB_PATH` environment variable at startup (for example, in the [.env](https://www.krenalis.com/docs/docs/configuration/the-env-file.md) file) to point to the `GeoLite2-City.mmdb` file.
### When `context.location` is not automatically populated
Krenalis will **not** populate [`context.location`](https://www.krenalis.com/docs/collect-events/spec/schema.md#location) automatically in the following cases:
* The event includes a manually specified value for [`context.location`](https://www.krenalis.com/docs/collect-events/spec/schema.md#location).
* The event includes [`context.ip`](https://www.krenalis.com/docs/collect-events/spec/schema.md#context) set to `0.0.0.0`.
* [`context.ip`](https://www.krenalis.com/docs/collect-events/spec/schema.md#context) is not provided and the event was not sent using the JavaScript SDK, Android SDK or iOS SDK.
* Krenalis was started without the `KRENALIS_MAXMIND_DB_PATH` environment variable set.
* The IP address is not found in the MaxMind database referenced by `KRENALIS_MAXMIND_DB_PATH`.