From e91a09680bded581b2b18a2ae5b5ee4090ce374c Mon Sep 17 00:00:00 2001 From: Courtney Garcia <97773072+courtneyga@users.noreply.github.com> Date: Tue, 16 Apr 2024 10:52:44 -0500 Subject: [PATCH] Update common.md --- src/connections/spec/common.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/connections/spec/common.md b/src/connections/spec/common.md index 383ea09782..0d2a931d07 100644 --- a/src/connections/spec/common.md +++ b/src/connections/spec/common.md @@ -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: