BehaviorPrint™ SDK Setup
Introduction
BehaviorPrint allows services to generate unique “fingerprints” for their mobile users based on an individual’s behavior. By applying advanced machine learning to motion data collected from the device, UnifyID is able to uniquely identify the human behind the device. This allows customers to detect when a single individual is using multiple accounts, or when a previously banned user is back with a new username.
BehaviorPrint allows you to:
- Protect your bottom line
Prevent promotions and referral abuse. - Strengthen the integrity of your platform and its content
Detect and lock out fraudulent/fake accounts. - Safeguard your community
Control spam and content abuse from malicious users.
When integrated into your app, the BehaviorPrint SDK operates passively in the background. Good users won’t notice a thing, and the users you catch won’t know what hit them.
Note: BehaviorPrint™ is currently being offered through a private beta. For more information about this product, please contact us at support@unify.id.
Browse the BehaviorPrint Android SDK
Browse the BehaviorPrint iOS SDK
Prerequisites
The BehaviorPrint Android SDK requires:
- Java 7 or greater
- Android API level 21 or greater
The BehaviorPrint iOS SDK requires:
- Swift 5.1 or greater
- iOS 10.0 or greater
- CocoaPods 1.10.0 or greater
Initializing the SDK
BehaviorPrint is in private beta. For access to the SDK, please contact us at support@unify.id.
Initialize an instance of BehaviorPrint with your SDK Key. Because this may attempt a network call, this should not be run in the main thread.
Android
new Thread(() -> {
try {
BehaviorPrint behaviorPrint = BehaviorPrint.getInstance(getApplicationContext(), sdkKey);
} catch (BehaviorPrintException e) {
......
}
}).start();
iOS
import BehaviorPrint
let behaviorPrint = BehaviorPrint(sdkKey: "mySDKKey")
Data collection begins upon initialization, even if no user context has been set. This allows BehaviorPrint to collect data for users even before they log in or sign up.
Data Collection and Upload
Data collection refers to both:
- Device data being captured and buffered locally
- Data being uploaded to UnifyID servers
Data is buffered locally and is uploaded based on a variety of factors, including:
- User account age (new accounts may initially upload data near real-time)
- Device conditions (Wi-Fi, battery level)
- User activity and behavior
BehaviorPrint will automatically and dynamically adjust data upload behavior over the course of a user’s lifetime.
Setting the User
Once a user has registered or logged in, you can provide a unique, immutable identifier to the BehaviorPrint instance. This attributes collected data to the user:
Android
String uniqueUserId = "xxxxxxxxx";
behaviorPrint.setUser(uniqueUserId);
iOS
let uniqueUserId: String? = "xxxxxxxxx"
behaviorPrint.user = uniqueUserId
This identifier must not change for a given user, so usernames and emails are not recommended if your service allows users to change those attributes.
As needed, you can query and clear the user from the BehaviorPrint instance (when logging out, for example):
Android
behaviorPrint.clearUser();
iOS
behaviorPrint.user = nil
Pausing and Resuming Data Collection
BehaviorPrint begins collecting data immediately upon initialization. At any point, whether or not a user has been set, you can choose to pause and resume data collection. This could be useful if, for example, you do not wish to collect data prior to login or signup:
Android
// Pause data colletion
BehaviorPrint behaviorPrint = BehaviorPrint.getInstance(sdkKey);
behaviorPrint.pause();
// When you wish to resume data collection
behaviorPrint.resume();
iOS
// Pause data colletion
behaviorPrint.isRunning = false
// Later, when you wish to resume data collection
behaviorPrint.isRunning = true
Events
In addition to collecting gait and data, you can also tell BehaviorPrint about specific events or actions taken by the user. The following global events are currently supported:
Android
// Send immediately after registration, *after* the user has been set
behaviorPrint.track(Event.SIGNUP);
// Send after an existing user has signed in, *after* the user has been set
behaviorPrint.track(Event.LOGIN);
// Send when a user logs out, *prior* to clearing the user
behaviorPrint.track(Event.LOGOUT);
iOS
// Send immediately after registration, *after* the user has been set
behaviorPrint.track(.signup)
// Send after an existing user has signed in, *after* the user has been set
behaviorPrint.track(.login)
// Send when a user logs out, *prior* to clearing the user
behaviorPrint.track(.logout)
BehaviorPrint API
As data is collected, BehaviorPrint continuously looks for user accounts that have a high likelihood of belonging to the same physical person. This data can be consumed through a variety of channels:
- Webhooks
Set up a webhook endpoint on your server, and UnifyID will call your endpoint when a match is detected. - User Lookup API
Look up the status for a specific user based on their user ID, and BehaviorPrint will return matches with confidence scores. - Dashboard
The UnifyID Developer Dashboard provides a convenient user lookup interface on the web.
For additional information about the BehaviorPrint API, please contact us at support@unify.id.