Skip to content

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.

properties = {
// customProperties object
};
_cl.group(properties)
  • group_traits: A reserved property under customProperties that 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 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.

KeyDescription
identify_by_companyCompany name used as identifier
identify_by_websiteCompany website used as identifier
company_nameCompany name
company_websiteCompany website
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);

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)
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");