Tracking Users

Track Users activity through NotifyVisitors

User API enables you to track a users' activity as they move from device to device and attach attributes to their profiles. Attributes enrich user profiles, like email, username, mobile, gender etc.
This method should be called when the user is identified (mostly on login).

NotifyVisitors.userIdentifier((String) userID, (JSONArray)attributes);


var attributes = {name : "UserName",  number : "012345678" };



  • You can add more information to your Notifyvisitors User Profile and create a user segment for different category of people with specific profile property predefined by you.
  • You can build new campaigns to engage your users for each segment that you create.
  • Secondly, by adding more info to your Notifyvisitors User Profile you can personalize your messaging for the campaigns with related information.
  • The third benefit includes personalizing your app created from information from the specific users Notifyvisitors User Profile.

User ID

It is important to set a unique ID so you can easily identify users across different devices. You can identify them whether the users install or uninstall your website or app across different platforms-

  • Android
  • iOS
  • Windows
  • The Web
  • ID that is backend generated


Must Read:

We recommend that you must get familiar with all the concepts that are related with
Events and Users before you proceed to track users. It will help you to get a better grasp of this section.

As soon as you integrate your platform through our SDKs - which may be a website or an app, Notifyvisitors begins to detect users immediately. You can assign unique user ID to each user to identify them.

Every time a user visits your site, the SDK at Notifyvisitors creates a unique identity for the visitor. We are able to record users with the generated ID and also create a secret anonymous profile. The user’s behavioral data and along with it the session data is stored under the secret profile. The session data includes information like:

  • Custom Events
  • System Events
  • System Attributes of Users’
  • Custom Attributes of Users’



Once user ID is assigned to the user, it cannot be changed further. Therefore make sure you pass system generated user ID instead of email or phone number which can be changed by user in future. The maximum limits for the unique user ID should have a limit of maximum 100 character.

We suggest that you should assign a unique ID- also referred to as CUID (Cluster Unique Identifier) at any of the following instances of User Lifecycle:

  • When User signs up
  • When User logs in
  • When user views pages where the ID becomes known
  • On change of User context

When a Cluster Unique Identifier or a CUID has been assigned to a User:

  • The user is now identified and now falls in the known user category
  • Automatically a fresh Profile for known-User Profile is created, containing all their data
  • All of their previous anonymous profiles get merged at this point to help you view a combined profile under the known-User Profile

The User API allows you to track the activity of users’ as they switch from device
to device and keep adding attributes to the profiles. You can use these attributes
to enrich profiles. The attributes include:

  • Email
  • Username
  • Gender
  • Mobile
    You can use the API method upon identifying the user, which happens mostly at login.


How does it Work:

How are profiles merged at the moment when the User is identified or CUID is assigned to the user?
Say, a user before signing up visits your app a couple of times.

  • Day 1 Visit to App: Notifyvisitors gives them a locally-unique identifier or LUID and makes a anonymous user profile automatically which maintains all their data (Anonymous Profile i).
  • User A revisits on Day 4: Notifyvisitors assigns a LUID again and yet creates one more anonymous profile and records data (Anonymous Profile ii).
  • Again the user revisits the app on Day 7 and then registers for an account: This time you assign a CUID to the user. This will create a new profile.
  • The moment a Known User Profile is made, Notifyvisitors will make a quick check for previously created anonymous user profiles after identifying them.
  • Now, the Anonymous Profile i and Profile ii will be merged into the final profile of the User A. Hereon, there will be a unified view of the User A profile with record of the user’s behavioral history and preferences.


  • All APIs related to users are a part of Notifyvisitors’ user object of the Android SDK
  • You cannot change your assigned user ID
  • You cannot change your assigned user ID
  • Maximum number of characters allowed in making your user ID have to be under a 100 characters
  • User ID cannot be changed further once established. Unique ID means having a distinctive user identity.

User Attributes

User Attribute are Attributes related to the user profile as following:

  • User's name
  • Email address
  • Location

There are two types of User Attributes:

  • System User Attributes
  • Custom User Attributes

Both attributes are tracked for known users and anonymous users

System User Attributes

System user attributes are the attributes which are passed by you and recognized by Notify visitors system.


  • Notifyvisitors’ allows professionals to assign values to all attributes for your app users.
  • System User Attributes cannot be used for segmenting the users.
  • You can use the attributes to configure personalize messages.
  • They are better than event attributes which may take different values in every session
  • Record details using User attributes as they do not change and their details are the same throughout one session.

Look at the below table to refer to the system attributes :

Attribute KeyAttribute ValueAttribute description
emailstringEmail ID
mobilestringPhone number of the user in E.164 format
eg. +551155256325, +917850009678
birth_dateDateBirth date in YYYY-MM-DD format
genderstringGender - value can only be one of male, female, other
email_opt_ininteger1 -> reachable on email 0 -> not available , 2 -> bounced
sms_opt_ininteger1 -> reachable on sms , 0 -> not available , 2 -> invalid
whatsapp_opt_ininteger1 -> opt in for whatsapp , 0 -> no, 2 -> invalid
hashed_emailstringEncrypted email address for use with a private ESP
hashed_mobilestringEncrypted phone number for use with a private ESP

Setting System Attribute


NotifyVisitors.userIdentifier("1331", {name:"John"});


NotifyVisitors.userIdentifier("1331", {email:"[email protected]"});

Hashed Email
Businesses do not like to share their users’ contact details with a third-party platform
like NotifyVisitors. So we have provided you to pass encrypted email IDs in the
system user attribute.

NotifyVisitors.userIdentifier("1331", {hashed_email:"144e0424883546e07dcd727057fd3b62"});

Mobile No

NotifyVisitors.userIdentifier("1331", {mobile:"+919999999999"});

Birth Date (in YYYY-MM-DD format)

var attributes = {
NotifyVisitors.userIdentifier("1331", attributes);

Opt In Status

  • Set subscription preference of your users for:
  1. SMS
  2. Email
  3. WhatsApp 

Use the following methods:

var attributes = {
NotifyVisitors.userIdentifier("1331", attributes);
  • Those user who have shared their phone number and email address and automatically opted in to SMS and Email respectively.
  • By default the WhatsApp opt-in setting is false. When the users decide to opt-in to channel you would have to set it to true
  • If the Users happen to opt-out of a channel, they will stop receiving and communications through that specific channel.

Custom Attributes

Custom attributes are the additional details passed by you for users . You can pass the user system attributes like name, email, mobile and whatsapp_opt_in in and,
Custom attributes like user__score, plan_type etc as given below :

var attributes = {
  email:"[email protected]",
NotifyVisitors.userIdentifier("1331", attributes);

Important Points :

  1. Values of an attribute can have only one of the following data types :Boolean, Number, String, Date, Map and Array.
  2. There are maximum 25 custom attributes per datatype. For example, 25 custom attributes of Number data type and 25 custom attributes of String data type etc.
  3. The maximum length of a String data type for an attribute is 1000 characters.
  4. The maximum length of an attribute Key is 50 characters.
  5. Attribute Names should contain only alpha-numeric, white spaces or "" ; No other special characters are allowed. Recommended names should be - ‘first name’, ‘last_name’

Complex Attributes

Your user details may have more complex info like

  • Array
  • objects
var attributes = {
  email:"[email protected]",
  	"Flat" : "h-3/94",
    "Building Number" : "B2",
    "Locality" : "Bengali Road",
    "City"     : "Palam",
    "State"    : "Delhi",
    "PIN"      : "110045"
NotifyVisitors.userIdentifier("1331", attributes);