Skip to main content

Overview

This guide provides instructions for passing user data, such as User ID, Email, and additional details (e.g., Name, Mobile Number), to the AppTrove Flutter SDK. Associating user data with events enhances tracking and allows correlation with Trackier data and logs for improved attribution and analytics.

Prerequisites

  • A Flutter application with the AppTrove SDK installed and initialized
  • Flutter 2.0 or later, Dart 2.12 or later
  • Basic knowledge of Dart and Flutter development

User Data

Trackier allows you to pass user data, such as User ID, Email, and additional details, to the SDK. This data can be correlated with Trackier's data and logs to enhance tracking accuracy and provide richer analytics.

Passing User Data to SDK

You can pass essential user information like User ID and Email using dedicated SDK methods. Additionally, you can include extra user details (e.g., Name, Mobile Number) using a Map.

Dart Example

UserDetails.dart
void userDetails() {
/* Passing the UserId and User EmailId Data */
Trackierfluttersdk.setUserId("XXXXXXXX"); // Pass the UserId values here
Trackierfluttersdk.setUserEmail("abc@gmail.com"); // Pass the user email id in the argument
}

Dart Example with Additional Data

UserDetails.dart
void userDetails() {
/* Passing the UserId and User EmailId Data */
Trackierfluttersdk.setUserId("XXXXXXXX"); // Pass the UserId values here
Trackierfluttersdk.setUserEmail("abc@gmail.com"); // Pass the user email id in the argument

/* Passing the additional data */
var userDetails = Map<String, Object>();
userDetails["name"] = "abcd"; // You can pass the Username data
userDetails["mobile_number"] = "872xxxxx87"; // You can pass user mobile number
Trackierfluttersdk.setUserAdditonalDetail(userDetails);
}

Available Methods

  • setUserId(String): Sets a unique user identifier.
  • setUserEmail(String): Sets the user's email address.
  • setUserAdditonalDetail(Map<String, Object>): Sets custom key-value pairs for additional user metadata (e.g., name, mobile number, age, gender).

Best Practices

  • Set User Data Early: Pass user data as soon as it's available (e.g., after login) to ensure all subsequent events are associated with the user.
  • Use Unique Identifiers: Ensure the User ID is unique to avoid data conflicts in Trackier's logs.
  • Secure Sensitive Data: Handle user data (e.g., Email, Mobile Number) in compliance with privacy regulations (e.g., GDPR, CCPA).
  • Test in Development Mode: Use "development" or "testing" environments to verify user data integration without affecting production data.

Troubleshooting

  • User Data Not Recorded: Ensure user data methods (e.g., setUserId, setUserAdditonalDetail) are called before tracking events.
  • Invalid Data Format: Verify that the Map used in setUserAdditonalDetail contains valid key-value pairs.
  • Data Not Visible in Dashboard: Confirm that the SDK is initialized correctly and the user data is being sent to the Trackier servers.

For further assistance, refer to the Trackier Documentation Portal or contact Trackier support at support@trackier.com.