Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/connections/spec/common.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ Other libraries only collect `context.library`, any other context variables must

- 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.

- Segment doesn't collect or append to the context of subsequent calls in the new mobile libraries (Swift, Kotlin, and React Native).

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:

```js
Expand All @@ -218,6 +220,11 @@ analytics.track("Report Submitted", {},
);
```

To add fields to the context object in the new mobile libraries, you must utilize a custom plugin. Documentation for creating plugins for each library can be found here:
- [React Native](/docs/connections/sources/catalog/libraries/mobile/react-native/#plugin-architecture)
- [Swift](/docs/connections/sources/catalog/libraries/mobile/apple/swift-plugin-architecture/)
- [Kotlin](/docs/connections/sources/catalog/libraries/mobile/kotlin-android/kotlin-android-plugin-architecture/)


## Integrations

Expand Down