Skip to content

Commit e91a096

Browse files
authored
Update common.md
1 parent 4677164 commit e91a096

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)