# Schema The following example shows how an event appears in Krenalis after it has been received and processed. It illustrates most of the fields defined in the event schema. In real scenarios, the actual set of fields varies depending on the type of event sent, the SDK used, and the user's state (authenticated or anonymous). ```json { "kpid": "8bde45c4-92a1-4d8a-a2ce-36f70cfd1f52", "connectionId": 129402661, "anonymousId": "f8d65981-a881-4fe4-b7fc-9e7c4a339019", "channel": "web", "category": "E-commerce", "context": { "app": { "name": "Krenalis Storefront", "version": "2.3.1", "build": "23104", "namespace": "com.krenalis.storefront" }, "browser": { "name": "Chrome", "version": "129.0.6668" }, "campaign": { "name": "Seasonal Promotion", "source": "newsletter", "medium": "email", "term": "fall-sale", "content": "header-banner" }, "device": { "id": "A1B2C3D4E5F6", "advertisingId": "7e11a1dc-09c3-42a2-9414-87e5a4c8f1a7", "adTrackingEnabled": true, "manufacturer": "Apple", "model": "MacBookPro18,3", "name": "Mary's MacBook Pro", "type": "desktop", "token": "device-token-9d82f3" }, "ip": "73.112.88.145", "library": { "name": "krenalis.js", "version": "1.0.0" }, "locale": "en-US", "location": { "city": "San Francisco", "country": "United States", "latitude": 37.7749, "longitude": -122.4194, "speed": 0 }, "network": { "bluetooth": false, "carrier": "Verizon", "cellular": false, "wifi": true }, "os": { "name": "macOS", "other": null, "version": "14.4.1" }, "page": { "path": "/products/wool-jacket", "referrer": "https://www.mystore.com/", "search": "?color=navy&size=m", "title": "Wool Jacket – Krenalis", "url": "https://www.mystore.com/products/wool-jacket?color=navy&size=m" }, "referrer": { "id": "newsletter-seasonal", "type": "email" }, "screen": { "width": 2560, "height": 1600, "density": 2.00 }, "session": { "id": 1760443328460, "start": false }, "timezone": "America/Los_Angeles", "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 14_4_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.6668.100 Safari/537.36" }, "event": "Product Added", "groupId": "acme-inc", "messageId": "08fa701f-49b7-4253-b3c4-1504e49004ec", "properties": { "product_id": "SKU-001247", "product_name": "Women's Wool Jacket", "category": "Outerwear", "price": 149.99, "currency": "USD", "quantity": 1, "coupon": "SUMMER_SALE", "inventory_status": "in_stock", "color": "navy", "size": "M" }, "receivedAt": "2025-10-14T15:32:48.985Z", "sentAt": "2025-10-14T15:32:47.610Z", "originalTimestamp": "2025-10-14T15:32:46.820Z", "timestamp": "2025-10-14T15:32:46.820Z", "traits": { "name": "Mary Johnson", "email": "mary.johnson@example.com", "gender": "female", "country": "United States", "city": "San Francisco", "plan": "premium", "age": 32 }, "type": "track", "previousId": "temp-548271", "userId": "user-982174" } ``` ## The event schema The event schema defines the structure of an event, similar to how the profile schema (Customer Model Schema) defines the structure of a user. Unlike the profile schema, which can be customized for each organization, the event schema is predefined. The **Optional** column indicates whether a property may be missing from the event data after it is received and processed by Krenalis. | Property | Type | Optional | Description | |-----------------------|------------|--------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `kpid` | `uuid` |
| Krenalis Profile ID. Identifies the user profile associated with this event. | | `connectionId` | `int(32)` | | Identifier of the source connection from which the event was received. Set by Krenalis when the event is sent via an SDK or the API using an [event write key](https://www.krenalis.com/docs/api/authentication.md#event-write-keys). | | `anonymousId` | `string` | | Unique identifier assigned to a user before authentication, used to track anonymous activity across sessions. Set by the SDK or, if missing, by Krenalis. | | `channel` | `string` |
| Source channel through which the event was received (e.g., web, mobile, server). | | `category` | `string` |
| Used to group related pages or screens for analysis and reporting. | | [`context`](#context) | `object` |
| Information about the environment where the event occurred (device, app/OS, page/screen, network, locale, campaign, library). Populated automatically when events are sent using the [JavaScript SDK](https://www.krenalis.com/docs/integrations/javascript-sdk.md), the [Android SDK](https://www.krenalis.com/docs/integrations/android-sdk.md) or the [iOS SDK](https://www.krenalis.com/docs/integrations/ios-sdk.md). | | `event` | `string` |
| Name of the user action in a [track](https://www.krenalis.com/docs/collect-events/spec/track.md) event. Examples: Product Viewed, Order Completed. Not to be confused with the `name` property used in [page](https://www.krenalis.com/docs/collect-events/spec/page.md) or [screen](https://www.krenalis.com/docs/collect-events/spec/screen.md) events. | | `groupId` | `string` |
| Identifier of the group (e.g., account, company, organization) associated with the user. | | `messageId` | `string` | | Unique, immutable identifier for the event. Set by the SDK; if omitted, Krenalis automatically assigns one. | | `name` | `string` |
| Title of the viewed page or screen in [page](https://www.krenalis.com/docs/collect-events/spec/page.md) and [screen](https://www.krenalis.com/docs/collect-events/spec/screen.md) events. Not to be confused with the `event` property used in [track](https://www.krenalis.com/docs/collect-events/spec/track.md) events. | | `properties` | `json` |
| Key–value pairs describing contextual details about the event (e.g., product_id, revenue, rating). Distinct from `traits`, which describe user attributes. | | `receivedAt` | `datetime` | | UTC timestamp indicating when the event was received. Set by Krenalis. | | `sentAt` | `datetime` | | UTC timestamp indicating when the event was sent by the client. Set by the SDK and not reliable for analysis due to potential client clock drift; use `timestamp` for analytics. | | `originalTimestamp` | `datetime` | | UTC timestamp indicating when the event occurred on the client, in ISO 8601 format. Pass this property if the event occurred in the past. Not recommended for analysis due to possible clock drift; use `timestamp` instead. | | `timestamp` | `datetime` | | UTC timestamp indicating when the event occurred, in ISO 8601 format. Set by the SDK and adjusted by Krenalis. Suitable for analysis. | | `traits` | `json` | | Key–value pairs containing user information (e.g., name, email, plan). | | `type` | `string` | | Event type: one of [page](https://www.krenalis.com/docs/collect-events/spec/page.md), [screen](https://www.krenalis.com/docs/collect-events/spec/screen.md), [track](https://www.krenalis.com/docs/collect-events/spec/track.md), [identify](https://www.krenalis.com/docs/collect-events/spec/identify.md), [group](https://www.krenalis.com/docs/collect-events/spec/group.md), or alias. Set by the SDK. | | `previousId` | `string` |
| User's previous identifier, passed to Krenalis but not used. | | `userId` | `string` |
| Unique identifier assigned to a user after authentication. If absent, the user is anonymous. | ## Context Information about the environment where the event occurred. Populated automatically when events are sent using the [JavaScript SDK](https://www.krenalis.com/docs/integrations/javascript-sdk.md), the [Android SDK](https://www.krenalis.com/docs/integrations/android-sdk.md) or the [iOS SDK](https://www.krenalis.com/docs/integrations/ios-sdk.md). | Property | Type |
Optional
| Description | |---------------------------------|----------|---------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [`context.app`](#app) | `object` |
| Information about the current application, including name, version, and build. | | [`context.browser`](#browser) | `object` |
| Information about the browser (name, version, type). | | [`context.campaign`](#campaign) | `object` |
| Details about the campaign that originated the event, including name, source, medium, term, content, and custom UTM parameters. | | [`context.device`](#device) | `object` |
| Information about the device, including ID, advertising ID, manufacturer, model, name, and type. | | `context.ip` | `ip` |
| User's current IP address. It is automatically set by the [JavaScript SDK](https://www.krenalis.com/docs/integrations/javascript-sdk.md), the [Android SDK](https://www.krenalis.com/docs/integrations/android-sdk.md) and the [iOS SDK](https://www.krenalis.com/docs/integrations/ios-sdk.md). For more details see [IP address](https://www.krenalis.com/docs/collect-events/enrichment.md#ip-address). | | [`context.library`](#library) | `object` |
| Information about the SDK library used to send the event, including name and version. | | `context.locale` | `string` |
| User's language and regional settings, such as `en-US`. | | [`context.location`](#location) | `object` |
| Device location from which the event originated (city, country, latitude, longitude, speed). | | [`context.network`](#network) | `object` |
| Network to which the device originating the event is connected. (Bluetooth, Wi-Fi, cellular, carrier). If both cellular and Wi-Fi are absent, the device is offline. | | [`context.os`](#os) | `object` |
| OS of the device from which the event originated (name, version). | | [`context.page`](#page) | `object` |
| Page information (path, referrer, title, URL). | | [`context.referrer`](#referrer) | `object` |
| Referrer information (ID, type). | | [`context.screen`](#screen) | `object` |
| Display details (width, height, pixel density). | | [`context.session`](#session) | `object` |
| Session details (ID, start flag). | | `context.timezone` | `string` |
| User's timezone as a tzdata string (e.g., `America/New_York`). May be unavailable due to privacy settings or lack of API support. | | `context.userAgent` | `string` |
| User agent string identifying the device or application sending the event. | ### App Information about the current application. | Property | Type |
Optional
| Description | |-------------------------|----------|---------------------------|-----------------------------------------------| | `context.app.name` | `string` |
| Application name. | | `context.app.version` | `string` |
| Application version. | | `context.app.build` | `string` |
| Application build identifier. | | `context.app.namespace` | `string` |
| Application namespace or internal identifier. | ### Browser Information about the browser. | Property | Type |
Optional
| Description | |---------------------------|----------|---------------------------|-----------------------------------------------| | `context.browser.name` | `string` |
| Browser name (e.g., Chrome, Safari, Firefox). | | `context.browser.other` | `string` |
| Custom or unrecognized browser name. | | `context.browser.version` | `string` |
| Browser version. | ### Campaign Details about the campaign that originated the event. | Property | Type |
Optional
| Description | |----------------------------|----------|---------------------------|----------------------------------------| | `context.campaign.name` | `string` |
| Campaign name. | | `context.campaign.source` | `string` |
| Campaign source. | | `context.campaign.medium` | `string` |
| Campaign medium (e.g., email, social). | | `context.campaign.term` | `string` |
| Campaign keyword or term. | | `context.campaign.content` | `string` |
| Campaign content or variation. | ### Device Information about the device. For iOS, note that model identifiers may differ from marketed names (e.g., iPhone16,2 for iPhone 15 Pro Max). | Property | Type |
Optional
| Description | |------------------------------------|-----------|---------------------------|-------------------------------------------| | `context.device.id` | `string` |
| Device identifier. | | `context.device.advertisingId` | `string` |
| Advertising identifier. | | `context.device.adTrackingEnabled` | `boolean` |
| Indicates whether ad tracking is enabled. | | `context.device.manufacturer` | `string` |
| Device manufacturer. | | `context.device.model` | `string` |
| Device model. | | `context.device.name` | `string` |
| Device name. | | `context.device.type` | `string` |
| Device type (e.g., mobile, desktop). | | `context.device.token` | `string` |
| Unique device token. | ### Library Information about the SDK library used to send the event. | Property | Type |
Optional
| Description | |---------------------------|----------|---------------------------|-----------------------------------| | `context.library.name` | `string` |
| Name of the analytics library. | | `context.library.version` | `string` |
| Version of the analytics library. | ### Location The device location from which the event originated. | Property | Type |
Optional
| Description | |------------------------------|-------------|---------------------------|------------------------------------------------------------| | `context.location.city` | `string` |
| City. | | `context.location.country` | `string` |
| Country. | | `context.location.latitude` | `float(64)` |
| Latitude. | | `context.location.longitude` | `float(64)` |
| Longitude. | | `context.location.speed` | `float(64)` |
| Speed at which the device is moving, in meters per second. | ### Network The network to which the device originating the event is connected. If both `cellular` and `wifi` are absent, the device is offline. | Property | Type |
Optional
| Description | |-----------------------------|-----------|---------------------------|----------------------------------------------------| | `context.network.bluetooth` | `boolean` |
| Indicates whether Bluetooth is active. | | `context.network.carrier` | `string` |
| Mobile network carrier name. | | `context.network.cellular` | `boolean` |
| Indicates whether a cellular connection is active. | | `context.network.wifi` | `boolean` |
| Indicates whether Wi-Fi is active. | ### OS OS of the device from which the event originated | Property | Type |
Optional
| Description | |----------------------|----------|---------------------------|------------------------------------------------------| | `context.os.name` | `string` |
| Operating system name (e.g., Android, iOS, Windows). | | `context.os.other` | `string` |
| Unrecognized operating system name. | | `context.os.version` | `string` |
| Operating system version. | ### Page Page information. | Property | Type |
Optional
| Description | |-------------------------|----------|---------------------------|------------------------| | `context.page.path` | `string` |
| Page path. | | `context.page.referrer` | `string` |
| Referring URL. | | `context.page.search` | `string` |
| URL search parameters. | | `context.page.title` | `string` |
| Page title. | | `context.page.url` | `string` |
| Full page URL. | ### Referrer Referrer information. | Property | Type |
Optional
| Description | |-------------------------|----------|---------------------------|-----------------------------| | `context.referrer.id` | `string` |
| Referrer source identifier. | | `context.referrer.type` | `string` |
| Referrer source type. | ### Screen Display details. | Property | Type |
Optional
| Description | |--------------------------|----------------|---------------------------|--------------------------| | `context.screen.width` | `int(16)` |
| Screen width in pixels. | | `context.screen.height` | `int(16)` |
| Screen height in pixels. | | `context.screen.density` | `decimal(3,2)` |
| Screen pixel ratio. | ### Session Session details. See also [Session tracking](https://www.krenalis.com/docs/collect-events/session-tracking.md). | Property | Type |
Optional
| Description | |-------------------------|-----------|---------------------------|-----------------------------------------------| | `context.session.id` | `int(64)` |
| Unique session identifier. | | `context.session.start` | `boolean` |
| Indicates whether the event starts a session. |