Tracking Group Accounts
The Group call lets you track the account/company information of a user. Whenever the group method is called, an event called “Create group” is automatically triggered inside CustomerLabs.
Syntax for group
Section titled “Syntax for group”properties = { // customProperties object};
_cl.group(properties)Parameters
Section titled “Parameters”- group_traits: A reserved property under
customPropertiesthat lets you track company details like name, website, address, revenue, etc. - identify_group_by: An attribute (flagged with
igb: true) that helps the system search for the group based on a unique identifier (like company website). - group_external_ids: An object that lets you track external identifiers for the group.
Group External IDs
Section titled “Group External IDs”Group External IDs work the same way as User External IDs but apply to a company or account profile. They are stored under the group_external_ids object.
Reserved Group External ID Keys
Section titled “Reserved Group External ID Keys”| Key | Description |
|---|---|
identify_by_company | Company name used as identifier |
identify_by_website | Company website used as identifier |
company_name | Company name |
company_website | Company website |
Building the customProperties for Group
Section titled “Building the customProperties for Group”Example: Create Group
Section titled “Example: Create Group”var properties = { "customProperties": { "group_traits": { "t": "Object", "v": { "company_name": { "t": "string", "v": "ABC Corporation" }, "company_website": { "t": "string", "v": "www.example.com" }, "no_of_employees": { "t": "number", "v": "10" }, "company_location": { "t": "string", "v": "New York" } } }, "identify_by_website": { "t": "string", "v": "www.example.com", "igb": true // Used to identify the group }, "group_external_ids": { "t": "Object", "v": { "company_website": { "t": "string", "v": "www.example.com" }, "company_name": { "t": "string", "v": "ABC Corporation" }, "identify_by_company": { "t": "string", "v": "ABC Corporation" }, } } }};_cl.group(properties);Update Group Event
Section titled “Update Group Event”Use the “Update group” event to update the details (group_traits) of an existing group during a session.
Function Signature:
_cl.group("Update group", properties)Example: Update Group
Section titled “Example: Update Group”var properties = { "customProperties": { "group_traits": { "t": "Object", "v": { "company_name": { "t": "string", "v": "ABC Corporation" }, "company_website": { "t": "string", "v": "www.example.com" }, "no_of_employees": { "t": "number", "v": "10" }, "company_location": { "t": "string", "v": "New York" } } }, "group_external_ids": { "t": "Object", "v": { "company_website": { "t": "string", "v": "www.example.com" }, "company_name": { "t": "string", "v": "ABC Corporation" }, "identify_by_company": { "t": "string", "v": "ABC Corporation" }, } } }};_cl.group(properties, "Update group");