User profiling for Flutter apps
Setting the user ID
- Before you begin, make sure that Apptics is integrated. Refer to the integration guide.
- Apptics allows you to associate the tracking data with a user id of an individual using your app. Setting a user id is not mandatory for Apptics to work normally.
- Use the below method to set the user id. All the data tracked after calling the below method will be associated with the given user id.
- User id tracking will happen with respect to tracking settings. If the tracking settings is set as 'Without PII', the data will not be associated with the user.
Copiedimport 'package:apptics_flutter/apptics_flutter.dart';
AppticsFlutter.instance.setUser(String? userId, [String? groupId])
Parameters:
userId - unique identifier for the user
groupId (optional) - identifier to group the users by one specific criteria
Example
Copiedimport 'package:apptics_flutter/apptics_flutter.dart';
AppticsFlutter.instance.setUser("user@example.com", "organizationId");
Remove the user ID
Call the below method to remove the user ID associated with the data. This will not affect the already associated data.
Copiedimport 'package:apptics_flutter/apptics_flutter.dart';
AppticsFlutter.instance.removeUser(String? userId, [String? groupId])
Parameters:
userId - unique identifier for the user
groupId (optional) - identifier to group the users by one specific criteria
Example
Copiedimport 'package:apptics_flutter/apptics_flutter.dart';
AppticsFlutter.instance.removeUser("user@example.com", "organizationId");