MCPcopy Create free account
hub / github.com/DavidWells/analytics / group

Function group

packages/analytics-plugin-segment/src/node.js:49–60  ·  view source on GitHub ↗
(groupId, traits = {}, options = {}, callback)

Source from the content-addressed store, hash-verified

47 methods: {
48 // Segment group call https://segment.com/docs/connections/sources/catalog/libraries/server/node/#group
49 group(groupId, traits = {}, options = {}, callback) {
50 const analyticsInstance = this.instance
51 const user = analyticsInstance.user()
52 const userId = options.userId || user.userId
53 const anonymousId = options.anonymousId || user.anonymousId
54 client.group({
55 ...(anonymousId ? { anonymousId } : {}),
56 ...(userId ? { userId } : {}),
57 groupId: groupId,
58 traits: traits,
59 }, callback)
60 },
61 // Function for using analytics-node client in other methods
62 getClient: () => client,
63 },

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected