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 .NET MAUI SDK. Associating user data with events enhances tracking and allows correlation with Trackier data and logs for improved attribution and analytics.

Prerequisites

  • A .NET MAUI application with the Apptrove SDK installed and initialized
  • .NET 10.0 or later
  • Basic knowledge of C# and .NET MAUI 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 Dictionary.

C# Example

void SetUserDetails()
{
/* Passing the UserId and User EmailId Data */
AppTroveSDK.SetUserId("XXXXXXXX"); // Pass the UserId values here
AppTroveSDK.SetUserEmail("abc@gmail.com"); // Pass the user email id in the argument
}

C# Example with Additional Data

void SetUserDetails()
{
/* Passing the UserId and User EmailId Data */
AppTroveSDK.SetUserId("XXXXXXXX"); // Pass the UserId values here
AppTroveSDK.SetUserEmail("abc@gmail.com"); // Pass the user email id

/* Passing the additional data */
var userDetails = new Dictionary<string, object>
{
{ "name", "abcd" }, // You can pass the Username data
{ "mobile_number", "872xxxxx87" } // You can pass user mobile number
};
AppTroveSDK.SetUserAdditionalDetails(userDetails);
}

Available Methods

  • SetUserId(string): Sets a unique user identifier.
  • SetUserEmail(string): Sets the user's email address.
  • SetUserName(string): Sets the user's display name.
  • SetUserPhone(string): Sets the user's phone number.
  • SetDOB(string): Sets the user's date of birth (YYYY-MM-DD format).
  • SetGender(AppTroveGender): Sets the user's gender (Male, Female, Others).
  • SetUserAdditionalDetails(Dictionary<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, SetUserAdditionalDetails) are called before tracking events.
  • Invalid Data Format: Verify that the Dictionary used in SetUserAdditionalDetails 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.