Skip to main content
Version: Javascript tag

Group assignation

You can assign group to your users, along with properties describing the group.

Requirements:
  • Group type and group id must be less than 128 characters long.
  • Authorized characters are alphanumeric (uppercase included) and you can insert the following special characters: '-' , '_' and ' ' (space).
$screeb('identity.group.assign', 'company', 'Apple');
$screeb('identity.group.assign', 'plan', 'Growth');

Default group type

Group type can be omitted:

$screeb('identity.group.assign', null, 'cohort-42'); 

From the Screeb platform, to customize the conditions the surveys are displayed for a visitor, you can apply custom targeting rules using group membership.

Group name vs group id

It is recommended to identify groups by using an immutable group id instead of a group name.

$screeb('identity.group.unassign', 'company', 'nuR4eecu', { name: 'Apple' });

Unassign group

At any time, you can unassign a user from a segment.

$screeb('identity.group.unassign', 'company', 'Apple');

Attributes

In order to bring context to your event handling, some properties can be added to the event.

Requirements:
  • Property names must be limited to 128 characters
  • No more than 1000 attributes
  • Supported types for values: string, number, boolean and Date.
// trigger custom event
$screeb('identity.group.assign', 'company', 'Apple', {
address_line_1: 'Apple Campus',
address_line_2: '1 Infinite Loop',
city: 'Cupertino',
zipcode: 95014,
state: 'California',
country: 'United states',
});