Unity Editor
Add Teak
You can use Unity Package Manager (See Unity Package Manager).
Or…
Download the latest Teak.unitypackage from https://sdks.teakcdn.com/unity/Teak.unitypackage
Import it into your project in Unity using
Then select Teak.unitypackage
Configure Teak
Open the Teak configuration in the Unity Inspector using
Put in your Teak App Id and Teak API Key. Your Teak App Id and API Key can be found in the Settings for your app on the Teak dashboard.
Make sure the Inspector tab is visible in your Unity window. |
Tell Teak how to Identify The Current User
Call the IdentifyUser
function and pass it a string which uniquely identifies the current user. This will also begin tracking and reporting of a session, and track a daily active user.
void IdentifyUser(string userIdentifier,
UserConfiguration userConfiguration);
// ...
// As soon as you know the id for the current user.
UserConfiguration userConfiguration = new UserConfiguration {
Email = "email@user.com"
};
Teak.Instance.IdentifyUser("user_123456", userConfiguration);
The userIdentifier value should be the same as you send to your back-end for a user id.
|
Opting Out of Tracking
If the user has opted out of data collection completely, do not call IdentifyUser
,
and Teak will not track the user at all.
If the user has opted out of specific data collection, set the corresponding
opt-out to true
in the user configuration.