You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some `userAgent` strings are frozen and contain less information. If you would like to request more information when it's available, you can pass an array of strings with fields you would like to request to the `highEntropyValuesClientHints` option. The example array below contains all possible values.
Copy file name to clipboardExpand all lines: src/connections/spec/common.md
+23-1Lines changed: 23 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,7 +75,25 @@ Here's an example of these common fields in raw JSON:
75
75
},
76
76
"groupId": "12345",
77
77
"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
+
}
79
97
},
80
98
"integrations": {
81
99
"All": true,
@@ -134,6 +152,7 @@ Context is a dictionary of extra information that provides useful context about
134
152
|`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. |
135
153
|`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). |
136
154
|`userAgent`| String | User agent of the device making the request. |
155
+
|`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. |
137
156
|`channel`| String | where the request originated from: server, browser or mobile |
138
157
139
158
@@ -180,6 +199,7 @@ Other libraries only collect `context.library`, any other context variables must
180
199
| screen.width || ✅ | ✅ |
181
200
| traits || ✅ | ✅ |
182
201
| userAgent | ✅ || ✅ |
202
+
| userAgentData*| ✅ |||
183
203
| timezone || ✅ | ✅ |
184
204
185
205
- 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
188
208
189
209
- The Android library collects `screen.density` with [this method](/docs/connections/spec/common/#context-fields-automatically-collected).
190
210
211
+
- userAgentData is only collected 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.
212
+
191
213
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:
0 commit comments