brytescore-android is the open-source Android SDK that connects your website with the Brytescore API. The Brytescore API allows you to track your users' behavior and score their engagement.
To run the example project, clone the repo, and build app
.
To install it, simply add the brytescore folder to your project's directory, then add the following line to your app's build.gradle:
compile project(path: ':brytescore')
Sets the API key. Generates a new unique session ID. Retrieves the saved user ID, if any.
- parameter {string} The API key.
brytescore = new Brytescore(getApplicationContext(), "<api-key>");
Returns the current API key
- returns: The current API key
String apiKey = brytescore.getAPIKey();
Function to load json packages.
- parameter {string} The name of the package.
brytescore.load("realestate");
Sets dev mode. Logs events to the console instead of sending to the API. Turning on dev mode automatically triggers debug mode.
- parameter enabled: If true, then dev mode is enabled.
brytescore.devMode(devMode);
Sets debug mode. Log events are suppressed when debug mode is off.
- parameter enabled: If true, then debug mode is enabled.
brytescore.debugMode(debugMode);
Sets impersonation mode. Bypasses sending information to the API when impersonating another user.
- parameter enabled: If true, then impersonation mode is enabled.
brytescore.impersonationMode(impersonationMode);
Sets validation mode. Adds a validation attribute to the data for all API calls.
- parameter enabled: If true, then validation mode is enabled.
brytescore.validationMode(validationMode);
Start tracking a property specific to a loaded package.
- parameter property: The property name
- parameter data: The property tracking data
brytescore.brytescore("<property-name>", propertyData);
Start a pageView.
- parameter data: The pageView data.
- data.isImpersonating
- data.pageUrl
- data.pageTitle
- data.referrer
brytescore.pageView(pageViewData);
Sends a new account registration event.
- parameter data: The registration data.
- data.isImpersonating
- data.userAccount.id
brytescore.registeredAccount(registeredAccountData);
Sends a submittedForm event.
- parameter data: The chat data.
- data.isImpersonating
brytescore.submittedForm(submittedFormData);
Sends a startedChat event.
- parameter data: The form data.
- data.isImpersonating
brytescore.startedChat(startedChatData);
Updates a user's account information.
- parameter data: The account data.
brytescore.updatedUserInfo(updatedUserInfoData);
Sends a user authentication event.
- parameter data: The authentication data.
- data.isImpersonating
- data.userAccount
- data.userAccount.id
brytescore.authenticated(authenticatedData);
Kills the session.
brytescore.killSession();