public void group ( @ NonNull final String groupId , @ Nullable final Traits groupTraits , @ Nullable final Options options ) { assertNotShutdown ( ) ; if ( isNullOrEmpty ( groupId ) ) { throw new IllegalArgumentException ( "groupId must not be null or empty." ) ; } analyticsExecutor . submit ( new Runnable ( ) { @ Override public void run ( ) { final Traits finalGroupTraits ; if ( groupTraits == null ) { finalGroupTraits = new Traits ( ) ; } else { finalGroupTraits = groupTraits ; } final Options finalOptions ; if ( options == null ) { finalOptions = defaultOptions ; } else { finalOptions = options ; } GroupPayload . Builder builder = new GroupPayload . Builder ( ) . groupId ( groupId ) . traits ( finalGroupTraits ) ; fillAndEnqueue ( builder , finalOptions ) ; } } ) ; }
The group method lets you associate a user with a group . It also lets you record custom traits about the group like industry or number of employees .