group()
Associate the current user with a company and update company attributes
The group()
method associates the currently identified user with a company and optionally updates the company’s attributes. Call this method once on any page where the user is working with a specific company. When the user switches to a different company, call usertour.group(newGroupId)
again to update the association.
When you provide attributes
, they will be merged with the company’s existing attributes in Usertour. Attributes not included in the call will retain their current values.
Parameters
The unique identifier for the company in your system.
Company attributes to update. See Attributes for details. These attributes can be used in flow content and conditions to personalize the user experience.
Membership attributes to update for the user’s relationship with the company. These attributes describe the user’s role or position within the company (e.g., “role”, “department”, “join_date”). They can be used in the Usertour UI just like company attributes.
Returns
A Promise
that resolves when the group association is complete.
Example
Notes
- Call this method when a user starts working with a specific company
- Call again when the user switches to a different company
- Company attributes are merged with existing values
- Membership attributes describe the user’s relationship with the company
- All attributes can be used in flow conditions and content