Tracking Users
Track user behavior in your Flutter app with Antsomi SDK. Identify users, create customer profiles & link attributes for personalized experiences.
Last updated
Track user behavior in your Flutter app with Antsomi SDK. Identify users, create customer profiles & link attributes for personalized experiences.
Last updated
Must Read
We recommend that you get yourself acquainted with all the concepts related to and before proceeding. Doing so will help you understand the workings of this section, better.
At Antsomi, we begin tracking users as soon as you integrate our SDKs into your platform. When a user opens your mobile app, our Antsomi SDK automatically assigns a unique ID known as a UID (User ID) to them. This helps us record users in our backend system and create an anonymous profile for them. All their behavioral data and session data (including System Events, Custom Events, System User Attributes, and Custom User Attributes) are stored under this anonymous profile.
You have the option to establish a connection between a user and a customer by utilizing a unique ID known as a CID (Customer ID). If there is no existing customer associated with the CID, this action will also result in the creation of a new customer, effectively linking the user to this newly created customer profile. This process ensures that both new and existing customers are seamlessly integrated into your system. We recommend assigning a CID at any of these key moments in the user's journey:
When a user signs up for your platform.
When a user logs in to their account.
When a user's identity becomes known, such as during specific screen views or interactions.
Assigning a CID to a user has several important implications:
It signifies that the user is now identified and recognized as a "Customer" in your CDP365 dashboard.
It initiates the creation of a new "Customer Profile" that contains all of the user's data (in case there aren't any Customer Profile associated with that CID in CDP yet).
Importantly, all previous anonymous profiles associated with the user are merged into this new "Customer Profile". This means that data from the user's first visit to your website to their most recent interactions can all be found in one user profile. This consolidation ensures a comprehensive view of the user's interactions with your platform.
Here are a few things to keep in mind when assigning a customer ID (CID) to identify your users:
A customer ID cannot be changed once it has been assigned.
While the unique customer ID (CID) can be any string
that effectively distinguishes users in your system, we strongly advise utilizing hashing methods, such as MD5 or SHA256, with user-specific information like email addresses or phone numbers as input. This approach enhances security and ensures the uniqueness of the generated IDs.
You can allocate a customer identification (CID) by invoking the setCustomerProps()
setter method. Any attributes, events, or session data gathered before utilizing this API are initially linked to an automatically generated anonymous user.
Upon the invocation of setCustomerProps()
, all the previously stored information becomes associated with the identified customer.
It's essential to trigger setCustomerProps()
promptly upon the user's login to your application or whenever you are capable of recognizing the user.
Remember to invoke the function setCustomerProperties()
after sending the login event so that our Antsomi SDK will automatically assign the current customer to every event afterward.
Make sure you call removeCustomer()
when the logged-in customer logs out, or you do not want to attach any future event, session, or user data with this customer until setCustomerProps()
is called again.
Additional details such as a name, email address, location, and more can be linked to your customer profile. Antsomi offers a convenient, all-in-one method for setting values for these customer attributes. The setCustomerProps()
method accepts a map as its parameter, where the key corresponds to the internal code of the customer attribute in CDP365, and the value represents the data you intend to assign to it. This streamlined approach simplifies enriching your customer profiles with essential information.
For example, in the sign-in event code snippet above, you can send more attributes beside customer_id
and name
, like the code snippet below