Install and initialize the Userpilot MAUI SDK, identify users, track screens and events, and configure optional settings.
The Userpilot MAUI SDK enables you to capture user insights and deliver personalized in-app experiences in real time. With a one-time setup, you can immediately begin leveraging Userpilot’s analytics and engagement features to understand user behavior and guide their journeys in-app.
Prerequisites
Before you begin, ensure your project meets the following requirements:
Installing the Library
NuGet Package (Recommended)
Install the Userpilot MAUI SDK — a single package that automatically includes the correct platform bindings:
Replace <latest_version> with the latest release version.
Or via the .NET CLI:
Project Reference (Local Development)
Add a project reference to the appropriate binding project in your .csproj file:
For Android, add the required NuGet dependencies:
Initialize the SDK
Initialize Userpilot during your app’s launch sequence. Replace <APP_TOKEN> with your Application Token from the Environments Page.
iOS
Android
Identify Users (Required)
Identify unique users and companies (groups of users) alongside their properties. Once identified, all subsequent tracked events and screens will be attributed to that user.
ImportantIt’s crucial to call the Userpilot identify function; without it, Userpilot won’t be able to recognize your users, and mobile content won’t be displayed to them.
Recommended Usage:
- On user authentication (login): Immediately call
Identify when a user signs in.
- On app launch for authenticated users: If the user has a valid session, call
Identify at app launch.
- Upon property updates: Whenever user or company properties change.
Properties Guidelines
- The
id key is required in company properties to identify a unique company.
- Userpilot supports String, Numeric, and Date types.
- Send date values in ISO8601 format.
- If you plan to use Userpilot’s localization features, pass the user property
locale_code with a value that adheres to ISO 639-1 format.
- Userpilot’s reserved properties have pre-determined types and improve the profiles interface in the dashboard:
- Use key
email to pass the user’s email.
- Use key
name to pass the user’s or company’s name.
- Use key
created_at to pass the user’s or company’s signup date.
Notes
- Make sure your User ID source is consistent across all platform installations (Web, Android, and iOS).
- While properties are optional, they are essential for Userpilot’s segmentation capabilities.
Track Screens (Required)
Tracking screens is crucial for unlocking Userpilot’s core engagement and analytics capabilities. Screen views are used to trigger eligible in-app experiences, improve targeting, and provide context for analytics by associating subsequent events with the currently active screen.
Track Events
Log any meaningful action the user performs. Events can be button clicks, form submissions, or any custom activity you want to analyze. Optionally, you can pass metadata as a JSON string.
Logout
When a user logs out, call Logout to clear the current user context. This ensures subsequent events are no longer associated with the previous user.
Anonymous Users
If a user is not authenticated, call Anonymous to track events without a user ID. This is useful for pre-signup flows or guest user sessions.
Anonymous users are counted towards your Monthly Active Users usage. You should take your account’s MAU limit into consideration before applying this API.
Experiences
Trigger a specific experience programmatically using its ID:
End the current active experience: