Identifying users
Initialize user sessions with the userIdentifier
method to identify users. Providing the externalId
is crucial as it uniquely identifies the user.
nudge.userIdentifier(externalId: "EXTERNAL_ID");
or
Nudge.getInstance().userIdentifier(externalId: "EXTERNAL_ID");
Sending User Properties
You can also send additional user properties for better targeting and segmentation:
Map<String,dynamic>? props = {
"tier" : "Gold",
"location" : "India",
"hasSubscribed" : false,
};
nudge.userIdentifier (
externalId : "EXTERNAL_ID",
name: "Jon",
email: "[email protected]",
phoneNumber: "9999999999",
properties: props
)
or
Map<String,dynamic>? props = {
"tier" : "Gold",
"location" : "India",
"hasSubscribed" : false,
};
Nudge.getInstance().userIdentifier(
externalId: "EXTERNAL_ID",
name: "NAME",
email: "EMAIL",
phoneNumber: "PHONE_NUMBER",
properties: props);
important
- User properties need to be passed in the
properties
parameter. - Only
externalId
,name
,email
, andphoneNumber
are passed outside theproperties
parameter.
Signing out users
Once the user signs out from your application, use the userSignOut
method provided by Nudge to clear any cached data for that user.
Nudge.getInstance().userSignOut()