Skip to content

Update Context Spec Code for GroupId #6396

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 3, 2024
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
8 changes: 5 additions & 3 deletions src/connections/spec/common.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,11 @@ Other libraries only collect `context.library`, any other context variables must
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
analytics.track("Report Submitted", {},
{"groupId": "1234"}
);
analytics.track("Report Submitted", {}, {
context: {
groupId: "1234"
}
});
```

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:
Expand Down
Loading