Skip to content

Commit 3e46e75

Browse files
Update common.md
1 parent 1687f2d commit 3e46e75

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

src/connections/spec/common.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,25 @@ Here's an example of these common fields in raw JSON:
7575
},
7676
"groupId": "12345",
7777
"timezone": "Europe/Amsterdam",
78-
"userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1"
78+
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36",
79+
"userAgentData": {
80+
"brands": [
81+
{
82+
"brand": "Google Chrome",
83+
"version": "113"
84+
},
85+
{
86+
"brand": "Chromium",
87+
"version": "113"
88+
},
89+
{
90+
"brand": "Not-A.Brand",
91+
"version": "24"
92+
}
93+
],
94+
mobile: false,
95+
platform: 'macOS'
96+
}
7997
},
8098
"integrations": {
8199
"All": true,
@@ -134,6 +152,7 @@ Context is a dictionary of extra information that provides useful context about
134152
| `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. |
135153
| `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). |
136154
| `userAgent` | String | User agent of the device making the request. |
155+
| `userAgentData` | Object | User agent data of the device making the request. 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> Only populates if the [Client Hints API](https://developer.mozilla.org/en-US/docs/Web/API/User-Agent_Client_Hints_API) is available on the browser. <br><br> This may contain more information than is available in the `userAgent` in some cases. |
137156
| `channel` | String | where the request originated from: server, browser or mobile |
138157

139158

@@ -180,6 +199,7 @@ Other libraries only collect `context.library`, any other context variables must
180199
| screen.width | |||
181200
| traits | |||
182201
| userAgent || ||
202+
| userAgentData* || | |
183203
| timezone | |||
184204

185205
- IP Address isn't collected by Segment's libraries, but is instead filled in by Segment's servers when it receives a message for **client side events only**.
@@ -188,6 +208,8 @@ Other libraries only collect `context.library`, any other context variables must
188208
189209
- The Android library collects `screen.density` with [this method](/docs/connections/spec/common/#context-fields-automatically-collected).
190210

211+
- userAgentData is only collected if the [Client Hints API](https://developer.mozilla.org/en-US/docs/Web/API/User-Agent_Client_Hints_API) is available on the browser.
212+
191213
To pass the context variables which are not automatically collected by Segment's libraries, you must manually include them in the event payload. The following code shows how to pass `groupId` as the context field of Analytics.js's `.track()` event:
192214

193215
```js

0 commit comments

Comments
 (0)