The CleverTap Unity Plugin for Mobile Customer Engagement and Analytics solutions.
For more information check out our website and documentation.
To get started, sign up here.
You can install the CleverTap Unity SDK using the .unitypackage Unity package or as a local package through Unity Package Manager (UPM).
- Download the latest version of the CleverTap Unity package. Import the
.unitypackageinto your Unity Project. Go to Assets > Import Package > Custom Package. - Add the PlayServiceResolver and the ExternalDependencyManager folders. These folders will install the EDM4U plugin, which automatically adds all the Android and iOS dependencies when building your project.
- Ensure that the scripts inside the
Editorfolder are added. TheAndroidPostImportscript sets upclevertap-android-wrapperlibrary for Android.IOSPostBuildProcessorandAndroidProjectPostProcessorscripts helps iOS and Android setup.
Clone the latest release version of CleverTap Unity SDK. The SDK can be imported as a local package through the Unity Package Manager.
CleverTap API can be accessed anywhere in your project by simply calling the static CleverTap class. No need to create GameObject or attach any script. The SDK handles the following:
- Instantiation of platform-specific binding (iOS, Android, Native)
- Creation of
GameObject - Script attachment.
Use the Unity Editor CleverTap Settings dialog (Assets -> CleverTap Settings) to automatically set your account configuration for iOS and Android builds.
You can view your CleverTap Account ID and CleverTap Account Token from the CleverTap Dashboard -> Settings.
For Unity Native builds initialize the SDK with the following code:
// Initialize CleverTap
CleverTap.LaunchWithCredentialsForRegion({YOUR_CLEVERTAP_ACCOUNT_ID}, {YOUR_CLEVERTAP_ACCOUNT_TOKEN}, {CLEVERTAP_ACCOUNT_REGION});Add an event listener for a callback directly through the CleverTap static events.
CleverTap.OnCleverTapDeepLinkCallback += YOUR_CALLBACK_METHOD;
CleverTap.OnCleverTapProfileInitializedCallback += YOUR_CALLBACK_METHOD;
CleverTap.OnCleverTapInAppNotificationButtonTapped += YOUR_CALLBACK_METHOD;iOS specific setup is described in the iOS Instructions
Android specific setup is described in the Android Instructions
WebGL specific setup is described in the WebGL Instructions
The SDK includes lifecycle controls designed for game loops:
- PauseSDK / ResumeSDK — Temporarily halt data collection during performance-critical gameplay. Events recorded while paused are buffered in memory and flushed automatically on resume, so no data is lost. Call
PauseSDK()when entering an active match or level andResumeSDK()when the player returns to a menu, lobby, or any screen where engagement tracking is meaningful.
void OnGameplayStart() => CleverTap.PauseSDK();
void OnGameplayEnd() => CleverTap.ResumeSDK(); // buffered events flush hereSee Usage Documentation for full details.
Check out the CleverTap Unity plugin SDK Change Log here.
If you have questions or concerns, you can reach out to the CleverTap support team from the CleverTap Dashboard.
TroubleShooting Guide: Please refer here if you are facing common integration issue.
