Skip to content

Commit af54374

Browse files
authored
Merge pull request #6396 from segmentio/courtneyga-patch-5
Update Context Spec Code for GroupId
2 parents f797816 + e91a096 commit af54374

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/connections/spec/common.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,11 @@ Other libraries only collect `context.library`, any other context variables must
215215
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:
216216

217217
```js
218-
analytics.track("Report Submitted", {},
219-
{"groupId": "1234"}
220-
);
218+
analytics.track("Report Submitted", {}, {
219+
context: {
220+
groupId: "1234"
221+
}
222+
});
221223
```
222224

223225
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:

0 commit comments

Comments
 (0)