Overview
Customer identification is a critical first step in the Flock referral system. By identifying your users, you enable:- Personalized referral experiences
- Accurate tracking of referral activities
- Proper attribution of rewards
- Access to user-specific campaign data
Always call the
identify() method after a user logs in or when your app starts with an authenticated user. This should be done before triggering any checkpoints or showing placements.Implementation
Use theidentify method to link a user’s identity with Flock:
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
externalUserId | String | Yes | Your unique identifier for the user in your system |
email | String | Yes | User’s email address |
name | String | Yes | User’s full name |
customProperties | Object | No | Additional user attributes for segmentation |
About externalUserId
The externalUserId is the primary identifier that links your user in your system to their profile in Flock:
- It should be unique and stable for each user
- Typically, this is the same ID you use in your database
Custom Properties
Custom properties allow you to segment users and personalize referral experiences:- Use them to track user attributes like subscription tier, user type, or purchase history
- These properties can be used for targeting specific user segments in campaigns
- Format varies slightly by platform (see examples above)
Custom properties should be simple key-value pairs. Complex nested objects are not supported.
Best Practices
- Call Early: Identify users as early as possible in your app’s lifecycle
- Consistent IDs: Use the same
externalUserIdacross all platforms for the same user - Update on Changes: Re-identify users when their information changes
- Privacy First: Only send necessary user information
- Error Handling: Implement proper error handling around identification calls
Next Steps
After successfully identifying your users, you can:- Trigger checkpoints to show referral experiences
- Display placements at strategic moments
- Trigger rewards for completed referrals