Skip to content

Commit d007a83

Browse files
authored
Adding context table
1 parent 8ab6642 commit d007a83

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

src/connections/spec/track.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,3 +168,28 @@ If the [Example Payload](https://segment.com/docs/connections/spec/track/#exampl
168168

169169
Here's what that Identify Action would look like :
170170
![Identify Action - Triggered by Button Clicked Track event with context traits](https://github.com/segmentio/segment-docs/assets/68755692/552d418d-abdd-4ec5-9253-da931f22f164)
171+
172+
## Context
173+
174+
Context is a dictionary of extra information that provides useful context about a datapoint, for example the user's `ip` address or `locale`. You should **only use** Context fields for their intended meaning.
175+
176+
| Field | Type | Description |
177+
| ----------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
178+
| `active` | Boolean | Whether a user is active. <br><br> This is usually used to flag an `.identify()` call to just update the traits but not "last seen." |
179+
| `app` | Object | dictionary of information about the current application, containing `name`, `version`, and `build`. <br><br> This is collected automatically from the mobile libraries when possible. |
180+
| `campaign` | Object | Dictionary of information about the campaign that resulted in the API call, containing `name`, `source`, `medium`, `term`, `content`, and any other custom UTM parameter. <br><br> This maps directly to the common UTM campaign parameters. |
181+
| `device` | Object | Dictionary of information about the device, containing `id`, `advertisingId`, `manufacturer`, `model`, `name`, `type`, and `version`. |
182+
| `ip` | String | Current user's IP address. |
183+
| `library` | Object | Dictionary of information about the library making the requests to the API, containing `name` and `version`. |
184+
| `locale` | String | Locale string for the current user, for example `en-US`. |
185+
| `network` | Object | Dictionary of information about the current network connection, containing `bluetooth`, `carrier`, `cellular`, and `wifi`. If the `context.network.cellular` and `context.network.wifi` fields are empty, then the user is offline. |
186+
| `os` | Object | Dictionary of information about the operating system, containing `name` and `version`. |
187+
| `page` | Object | Dictionary of information about the current page in the browser, containing `path`, `referrer`, `search`, `title` and `url`. This is automatically collected by [Analytics.js](/docs/connections/sources/catalog/libraries/website/javascript/#context--traits). |
188+
| `referrer` | Object | Dictionary of information about the way the user was referred to the website or app, containing `type`, `name`, `url`, and `link`. |
189+
| `screen` | Object | Dictionary of information about the device's screen, containing `density`, `height`, and `width`. |
190+
| `timezone` | String | Timezones are sent as tzdata strings to add user timezone information which might be stripped from the timestamp, for example `America/New_York`. |
191+
| `groupId` | String | Group / Account ID. <br><br> This is useful in B2B use cases where you need to attribute your non-group calls to a company or account. It is relied on by several Customer Success and CRM tools. |
192+
| `traits` | Object | Dictionary of `traits` of the current user. <br><br> This is useful in cases where you need to `track` an event, but also associate information from a previous Identify call. You should fill this object the same way you would fill traits in an [identify call](/docs/connections/spec/identify/#traits). |
193+
| `userAgent` | String | User agent of the device making the request. |
194+
| `userAgentData` | Object | The user agent data of the device making the request. This always contains `brands`, `mobile`, `platform`, and may contain `bitness`, `model`, `platformVersion`,`uaFullVersion`, `fullVersionList`, `wow64`, if [requested](/docs/connections/sources/catalog/libraries/website/javascript/#client-hints) and available. <br><br> This populates if the [Client Hints API](https://developer.mozilla.org/en-US/docs/Web/API/User-Agent_Client_Hints_API){:target="_blank"} is available on the browser. <br><br> This may contain more information than is available in the `userAgent` in some cases. |
195+
| `channel` | String | where the request originated from: server, browser or mobile

0 commit comments

Comments
 (0)