Menu

Quick Access

SDK Basic Information

SDK Name: SolarEngine Unity SDK v1.3.8

Developer: Huiliang Cloud (Beijing) Technology Co., Ltd.

SDK Version:  1.3.8

Features: SolarEngine (SE) is an all-in-one mobile app growth analytics and publishing intelligence platform. It supports data management across global channels, assisting developers to monitor every stage of business development. With our attribution and user-level ROI analysis, you'll be able to measure the true value every channel creates and optimize future growth strategies. SE also offers various analysis models and A/B testing feature to help fully visualize the user journey, identify potential pain points, implement targeted product enhancements and ultimately drive large-scale app growth.

Privacy Policy: https://www.solar-engine.com/privacyPolicyEN.html

Note:

The SolarEngine SDK supports Android 5.0 (API Level 21) and above.

Step 1: Get AppKey

Access Path:  Asset Management - App Management - AppKey

Please login to the live version and get appkey for your own product.

Step 2: Obtain SDK

2.1 Unity Plugin

      Download via  solarengine-unity-sdk-1.3.8zip

Version 1.3.8+. Corresponding iOS ≥ 1.3.3, Android ≥ 1.3.3.

      When using Unity 6, after building the project into an APK and installing it on an Android device, if you find the app icon fails to display on the home screen, or the app cannot be launched from the home screen, please refer to the link for resolution.

2.1.1 Import SDK

       1) Download the latest SDK zip package, and extract it to a local directory.

       2) Import  solarengine-unity-sdk.unitypackage into Unity.

Note: When you upgrade SDK version to 1.3.0.0 and above, you might encounter some issues. We have listed a few in Common Questions for your reference.

2.2 Package manager Integration

Starting from v1.3.2, automatic SDK integration via Package Manager is supported.
  1. Open the Window > Package Manager menu.
  2. Click the "+" button and select "Add package from git URL..."
  3. Enter https://github.com/solarengine-sdk/unity-sdk.git, then click "Add" and wait for the loading to complete.
  4. After loading, click "Import" when the pop-up window appears (only required for the first time). Once imported successfully, the folder "SolarEngineNet" will be displayed under the "Assets" directory.

If the folder does not appear:

  • Option 1: Manually import via SolarEngineSDK > UPM > Import Config
  • Option 2: Manually import by double-clicking Packages > SolarEngineSDK > PackagesContent > solarengine-unity-sdk-upm.unitypackage.

5.  Import the External Dependency Manager plugin:

Window > Package Manager > My Registries, locate External Dependency Manager for Unity, and click "Install".

       If the plugin is not found in My Registries:

  • Option 1: Click SolarEngineSDK > UPM > Add Registry to manually add it to My Registries

  • Option 2: If option 1 doesn't work, open Edit > Project Settings > Package Manager
Name: package.openupm.com
URL: https://package.openupm.com
Scope(s): com.google.external-dependency-manager

6.  The SDK shall work normally once imported.

2.3 SDK Demo

       Please refer to the GitHub open-source project for demo, in which you can find examples of how each method is called in the SolarEngineDemo.cs script.

Step 3: Integrate SDK

3.1 SDK Edit Settings

Clicking on "SolarEngineSDK-->SDK Edit Settings" will open the SolarEngineSettings panel.

SDK Edit Settings Introduction

Example

Click "Apply" and you'll receive a "success" notifcation as below. It means SDK settings are finished.


3.1.1 iOS

       1. For Xcode versions, 14.0 and above are supported.

       2. Accessible for iOS 11.0 and later.

       3. CocoaPods is required for the plugin. Please install following the guide here.

          (CocoaPods integration requires opening a file with the .xcworkspace extension.)

       4. If you want to integrate manually, please refer to the guide here.

3.1.2 Android

       1. Please make sure you can see this page after SDK version is upgraded.

           (First make sure the current Unity is on Android platform.)

       

       If successfully pulled, the SDK version under Plugins-->Android directory will be same as that you input into                         the panel before.

       If failed, please refer to the solution in Common Questions.

       2. Add the following permission into the AndroidManifest.xml file in your project.

       Access Path:  Assets/Plugins/Android/AndroidManifest.xml

<uses-permission android:name="android.permission.READ_PHONE_STATE" />

Note: The android.permission.READ_PHONE_STATE is a non-essential permission. If you are using the China Mainland version SDK, the SolarEngine SDK does not force developers to obtain this permission. If you have obtained this permission and the Android system is version 6.0 or higher, you will need to dynamically request this permission.

3.1.3 Mini Game

Add Global Macro Parameter

Wechat Mini Game:Requires integrating the open-source Unity to WeChat Mini Game plugin provided by the WeChat team
Douyin
Mini Game: Requires integrating the StarkSDK plugin provided by Toutiao
Douyin Cloud Game: Requires integrating the Cloud Acceleration SDK provided by Toutiao
Kuaishou Mini Game: Requires integrating the
Unity WebGL SDK provided by Kuaishou

Before formal integration, you need to add different global macro parameters for different platforms.

Wechat Mini Game: SOLARENGINE_WECHAT
Douyin Mini Game: SOLARENGINE_BYTEDANCE
Douyin Cloud Game: SOLARENGINE_BYTEDANCE_CLOUD
Kuaishou Mini Game: SOLARENGINE_KUAISHOU

The steps are as follows:

• Open the Project Settings window;

• Find Scripting Define Symbols, add a new line and enter the global macro parameter for the corresponding platform, then click the Apply button to complete the setup.

Douyin Mini Game

(Tuanjie Engine only) Before publishing to WebGL, please click SolarEngineSDK --> MiniGame --> Tuanjie --> BeforeBuildForTT.

Douyin Cloud Game

Follow:Douyin Mini Game Support Douyin Cloud

Follow:WeChat Mini Game Supports Tencent Event Callback

Integrating Mini Games via UPM in Tuanjie Engine

Due to incomplete support for LifeCycleBase (lifecycle hooks) in UPM integration mode within the Tuanjie Engine, automatically triggered lifecycle functions (such as beforeCopyDefault, afterBuildTemplate, etc.) may fail to execute properly for WeChat and Kuaishou Mini Games.

Therefore, if you choose to integrate the SolarEngineSDK Mini Game module via UPM, you must manually perform the build steps before and after building WeChat or Kuaishou Mini Games.
Before Build

SolarEngineSDK → MiniGame → Tuanjie → ManualAdd → BeforeBuildForKS
SolarEngineSDK → MiniGame → Tuanjie → ManualAdd → BeforeBuildForWxChat

After Build

SolarEngineSDK → MiniGame → Tuanjie → ManualAdd → AfterBuildForKS
SolarEngineSDK → MiniGame → Tuanjie → ManualAdd → AfterBuildForWxChat


Mini-Game Backend Configuration

Please refer to the Mini-Game Platform Backend Configuration section.

Wechat(weixin):  https://help.solar-engine.com/en/docs/Configure-Weixin-Official-Accounts-Platfrom
Douyin:  
https://help.solar-engine.com/en/docs/Configure-Douyin-Open-Platform
Kuaishou:  
https://help.solar-engine.com/en/docs/Configure-Kuaishou-Open-Platform


3.1.4 Windows

       Only need to configure either "China Mainland" or "Non-China-Mainland", then click "Apply".

3.1.4.1 Windows Software Uninstall Config

Because some data from the SDK is stored in AppData\LocalLow\Company Name (replace with your project name)\Product Name (replace with your project name)\com.solarengine, it is necessary to delete this file when the software is uninstalled.

Here's a .bat script:

  1. Replace Company Name and Product Name with your own project name, then save this file with a .bat extension.
  2. Run this script during uninstall.
@echo off
rem Define the path of the cache directory to be cleaned
set "cacheDir=%LOCALAPPDATA%\..\LocalLow\Company Name (to be replaced)\Product Name (to be replaced)\com.solarengine"

echo The value of cacheDir is: %cacheDir%

rem Clean the cache directory
if exist "%cacheDir%" (
    echo Cleaning the game cache directory...
    rd /s /q "%cacheDir%"
    echo The game cache directory has been cleaned.
) else (
    echo The game cache directory does not exist, no need to clean.
)

echo All cleaning operations are completed.
pause

3.1.5 OpenHarmony

3.1.5.1 Configure Permissions

Player Settings---> Other Settings--->Predefined Permissions

Add the following permissions, as shown in the figure.

ohos.permission.INTERNET//Required permission, allowing the app to send network requests.
ohos.permission.GET_NETWORK_INFO//Required permission, allowing the application to detect network status.
ohos.permission.APP_TRACKING_CONSENT//Required permission, allowing the application to obtain OAID. Note: The SDK must be initialized after this permission is obtained; if this permission is missing, it will affect device attribution.
ohos.permission.STORE_PERSISTENT_DATA//Required permission, allowing the application to retain the distinctID when uninstalled, which is used for device attribution.
3.1.5.2 Configure Obfuscation

If obfuscation configuration needs to be enabled during packaging, please add the following code to the obfuscation configuration file.

-keep
./oh_modules/@solarengine/core
3.1.5.3 Packaging

Currently, only the Export Project method is supported for packaging.

3.1.6 Mac OS

For packaging, you need to check "Create Xcode Project"

Step 4: Pre-Initialize SDK

       When the application is first launched after install, the SDK is pre-initialized. During pre-initialization, the SDK does not collect any personal information or report data to SolarEngine.

Function

public static void preInitSeSdk(string appKey)

Sample Code

SolarEngine.Analytics.preInitSeSdk("appkey");

Step 5: Initialize SDK(optional)

This configuration class is used to fine‑tune service capabilities and data‑collection behaviors during SDK initialization. Its parameters fall into three categories: core‑feature switches, auxiliary feature switches, and data collection switches.

   The config returned by this method is optional. If not set, the default values will be applied.

Sample Code

SEConfig seConfig = new SEConfig();
seConfig.logEnabled = true;

1. Core Feature Switches

   It controls the enablement or disablement of core SDK capabilities, directly determining whether core services such as attribution and analytics take effect.

   Note: Disabling relevant core feature switches will disrupt the data reporting. You will no longer be able to fully utilise all functions within SolarEngine dashboard.

MethodTypeRequiredDescription PlatformsExample
enableAttributionboolnoWhether to enable SolarEngine attribution service. Enabled by default. Disabling it will turn off all attribution relevant capabilities, including attribution results, deferred deeplink and deeplink, etc. If the analytics service is disabled at the same time, the SDK will stop reporting all data.iOS
Android
HarmonyOS
config.enableAttribution=true;
enableAnalyticsboolnoWhether to enable SolarEngine analytics service. Enabled by default. Disabling it can make all analytics features unavailable, such as A/B testing and online parameter. If the attribution service is disabled at the same time, the SDK will stop reporting all data.iOS
Android
HarmonyOS
config.enableAnalytics=true;

2. Auxiliary Feature Switches

It controls non‑core operational behaviors of the SDK, including its running mode, debug logs, network policies, authorization waiting, and auxiliary features such as deferred deeplink.

ParameterTypeRequiredDescriptionPlatformsExample
logEnabledboolNoWhether to enable local debug logs. Disabled by default.iOS
Android
HarmonyOS
Mini Game
Windows
MacOS
config.logEnabled=true;
isDebugModelbooleanNoWhether to enable debug mode. Disabled by default. Before using, please check function descriptioniOS
Android
HarmonyOS
Mini Game
Windows
MacOS
config.isDebugModel=true;
isGDPRAreaboolNoWhether it belongs to the GDPR region (Default false)iOS
Android
config.isGDPRArea=true;
isEnable2GReportingboolNoWhether to report events in 2G network. Disabled by default.iOS
Android
config.isEnable2GReporting=true;
adPersonalizationEnabledboolNoWhether users allow Google Ads to use their data for ad personalization,developers can customize this value. The field is not reported by default when left unset. Valid only on Android. iOS does not support this field, no configuration needed.Androidconfig.adPersonalizationEnabled=true
adUserDataEnabledboolNoWhether users allow Google Ads to use their data for ad personalization,developers can customize this value. The field is not reported by default when left unset. Valid only on Android. iOS does not support this field, no configuration needed.Androidconfig.adUserDataEnabled=true
isCoppaEnabledbool No Whether COPPA compliance is supported. Disabled by default.iOS Android config.isCoppaEnabled=true
isKidsAppEnabledboolNowhether Kids App mode is supported. Disabled by default.iOS
Android
config.isKidsAppEnabled=true
deferredDeeplinkenablebooleanNoWhether to enable deferred deeplink. Disabled by default.iOSAndroid HarmonyOSconfig.deferredDeeplinkenable=true;
authorizationTimeoutnumberNoMaximum waiting duration for user authorization result, in milliseconds. The SDK's internal waiting duration is used by default.HarmonyOSconfig.authorizationTimeout=120;
fbAppID string No If overseas developers need Meta attribution, set the Meta appid here. This parameter takes effect only on Android. iOS does not support this field and no configuration is required.Android config.fbAppID="";
enableSeparatedAttributionboolNoWhether to enable new attribution feature. After enabled, corresponding attribution results can be retrieved quickly.iOSAndroid HarmonyOSconfig.enableSeparatedAttribution=true;


MiniGameInitParams  Parameter Description

ParameterDescriptionTypeRequired
openidMini Game Open ID (If not provided, SDK will obtain the current Open ID automatically, but you must fill in the AppID and AppSecret in SE dashboard App Management; and configure it in Douyin/WeChat backend. See Backend Configuration.)stringno
anonymous_openidMini Game anonymous_openid (If not provided, SDK will obtain the current anonymous_openid automatically. You must fill in the AppID and AppSecret in SE dashboard App Management, same as openid. This parameter is only available for Douyin.)stringno
unionidmini game unionidstringno
isInitTencentAdvertisingGameSDKFollow:WeChat Mini Game Supports Tencent Event Callback
reportingToTencentSdk
tencentAdvertisingGameSDKInitParams

3. Data Collection Switches

It controls whether data such as IPv6, OAID and UA is collected.

   Note: Disabling corresponding data collection parameters will impair attribution and analytics services, and you will not be able to use relevant functions normally on SolarEngine dashboard.

ParameterTypeRequiredDescriptionPlatformsExample
enableIPV6boolNoWhether to collect IPv6 address. Set to false to disable collection. Default true (enabled).iOS/Android/HarmonyOSconfig.enableIPV6=true;
enableLanguageboolNoWhether to collect device language. Set to false to disable collection. Default true (enabled).iOS/Android/HarmonyOSconfig.enableLanguage=true;
enableLocaleboolNoWhether to collect device locale. Set to false to disable collection. Default true (enabled).iOS/Android/HarmonyOSconfig.enableLocale=true;
enableTimeZoneboolNoWhether to collect device time zone. Set to false to disable collection. Default true (enabled).iOS/Android/HarmonyOSconfig.enableTimeZone=true;
enableScreenWHboolNoWhether to collect screen width and height. Set to false to disable collection. Default true (enabled).iOS/Android/HarmonyOSconfig.enableScreenWH=true;
enableDensityboolNoWhether to collect screen density. Set to false to disable collection. Default true (enabled).Android/HarmonyOSconfig.enableDensity=true;
enableNetworkTypeboolNoWhether to collect network status. Set to false to disable collection. Default true (enabled).iOS/Android/HarmonyOSconfig.enableNetworkType=true;
enableUAboolNoWhether to collect User-Agent (UA). Set to false to disable collection. Default true (enabled).iOS/Android/HarmonyOSconfig.enableUA=true;
enableOAIDboolNoWhether to collect OAID. Set to false to disable collection.Android/HarmonyOSconfig.enableOAID=true;
enableODIDboolNoWhether to collect ODID. Set to false to disable collection.HarmonyOSconfig.enableODID=true;
enableAAIDboolNoWhether to collect AAID. Set to false to disable collection.HarmonyOSconfig.enableAAID=true;
isImeiEnabledboolNoWhether to collect IMEI. Set to false to disable collection.Androidconfig.isImeiEnabled=true;
isAndroidIDEnabledboolNoWhether to collect Android ID. Set to false to disable collection.Androidconfig.isAndroidIDEnabled=true;
withDisableOAIDRetryboolNoWhether to disable OAID retry. Default false.Androidconfig.withDisableOAIDRetry=true;
withDisableGAIDRetryboolNoWhether to disable GAID retry. Default false.Androidconfig.


Step 6: Use SDK

Funtion

public static void initSeSdk(string appKey, SEConfig seConfig)

Parameter Description

ParameterDescriptionTypeRequired
appKeyAppKey you obtained in Step 1StringYes
seconfigSolarEngine SDK configurationSEConfigYes

Sample Code

SEConfig seConfig = new SEConfig();
seConfig.logEnabled = true;
SolarEngine.Analytics.initSeSdk("appkey",seConfig);

//Mini Game Initialization Example
SEConfig seConfig = new SEConfig();
MiniGameInitParams initParams = new MiniGameInitParams();
initParams.anonymous_openid = "your anonymous_openid";
initParams.unionid = "your unionid";
initParams.openid = "your openid";
seConfig.miniGameInitParams = initParams;
seConfig.logEnabled = true;
SolarEngine.Analytics.initSeSdk("appkey",seConfig);  

//HarmonyOS Initialization Example

//Request OAID Permission
private void RequestPermissionsFromUserHandler()
{
#if UNITY_OPENHARMONY&&!UNITY_EDITOR
SolarEngine.Analytics.requestPermissionsFromUser(callback);
#endif

}
private void callback(int code)
{
//code :  0:Success  1:Fail  999:Error
Debug.Log( " requestPermissionsFromUser : " + code);
SEConfig seConfig = new SEConfig();
seConfig.logEnabled = true;
SolarEngine.Analytics.initSeSdk("appkey",seConfig);
}

 

Track initialization results

       This function is used to track the initialization results, to make sure the SolarEngine SDK is successfully initialized before you proceed with the following steps.

Parameter Description:

ParameterDescriptionTypeRequired
appKeyThe appkey you can get from SolarEngine dashboard.stringYES
seConfigSolarEngine SDK configurationsSEConfigYES

Sample Code

//Initialization
SolarEngine.Analytics.preInitSeSdk("appkey");    //PreInit should be called first.
SEConfig seConfig = new SEConfig();
seConfig.logEnabled = true;
seConfig.initCompletedCallback = onInitCallback;     //Here put initCallback into SEConfig.
SolarEngine.Analytics.initSeSdk("appkey", seConfig);

//InitCallback
private void onInitCallback(int code) {
        ///please refer to the codes below
}

Initialization callback codes:

codemeaning
0Initialization success
101Initialization failed, as pre-initialization is not called
102Initialization failed, due to illegal appkey
103Initialization failed, due to null context (Android only)
104Initialization failed, due to missing distinct_id (Android only)

Step 7: Get Attribution Results(Windows/MacOS is not supported)

The SDK provides an interface to obtain attribution result information, allowing developers to use the attribution data for event tracking and other logical processing.        

SolarEngine SDK provides two methods for obtaining attribution result information.

1. Set attribution result callback: When the SDK successfully or fails to obtain the attribution result, a callback will be given (asynchronous).

2. Get attribution result directly: Get the attribution results directly from the SDK cache. If the SDK has no attribution results yet, it will directly return nil (synchronous).

7.1 Set Attribution Result Callback(New)

Function

public struct SEConfig
{
    ...
        public Analytics.SEAttributionCallback uaAttributionCallback { get; set; }
        public Analytics.SEAttributionCallback reAttributionCallback { get; set; }

}

Sample Code

private void InitSDK()
{
    SEConfig seConfig = new SEConfig
    {
        enableSeparatedAttribution = true,
        uaAttributionCallback = OnUAAttributionReceived,
        reAttributionCallback = OnREAttributionReceived
    };

    Analytics.initSeSdk(AppKey, seConfig);
}

private void OnUAAttributionReceived(
    int code,
    Dictionary<string, object> attribution)
{
    HandleAttribution("UA", code, attribution);
}

private void OnREAttributionReceived(
    int code,
    Dictionary<string, object> attribution)
{
    HandleAttribution("RE", code, attribution);
}

private void HandleAttribution(
    string type,
    int code,
    Dictionary<string, object> attribution)
{
    Debug.Log(
        $"SEUnity: {type} attribution, code={code}, " +
        $"data={JsonConvert.SerializeObject(attribution)}");

    if (code == 0)
    {
        // Attribution success
    }
    else
    {
        // Attribution failed
    }
}
Important: For callback‑based attribution result retrieval, configure attribution listeners prior to invoking initialize. Defining listeners post‑initialization may cause imprecise attribution data. See the sample code above.

7.2 Get Attribution Result Directly(New)

The method for directly retrieving attribution results returns the local cache. If the local cache has not been generated yet, the attribution result will be null.

Function

 // Get new user attribution data
public static Dictionary<string, object> getUAAttributionData()
// Get re-targeting attribution data
 public static Dictionary<string, object> getREAttributionData()

Sample Code

Dictionary<string, object> uaAttribution = SolarEngine.Analytics.getUAAttributionData();
Debug.Log("[unity] getUaAttribution = "+ uaAttribution);

Dictionary<string, object> reAttribution = SolarEngine.Analytics.getREAttributionData();
Debug.Log("[unity] getReAttribution = "+ reAttribution);

Attribution error code descriptions and detailed attribution results can be found in:  

https://help.solar-engine.com/en/docs/SDK-Attribution-Result-Details

7.3 Attribution Result Example

IOS/Android

Attribution error code descriptions and detailed attribution results can be found in:

https://help.solar-engine.com/en/docs/SDK-Attribution-Result-Details

Mini Game

{ 
           "app_platform": "minigame",
            "app_type": "",
            "appkey": "",
            "attribution_method": "",
            "brand": "HUAWEI",
            "channel_id": "-1",
            "channel_name": "organic",
            "collector_version": "1.0.1.0",
            "container_name": "",
            "country": "CN",
            "current_event_time": "",
            "custom_params": {
                "_app_name": "",
                "_browser": "",
                "_channel": "",
                "_city": "chaoyang",
                "_country": "CN",
                "_country_code": "CN",
                "_distinct_id_type": "1101",
                "_event_type": "1",
                "_experiment_group_id_list": "[]",
                "_group_id_list": "[]",
                "_is_first_day": "true",
                "_is_first_time": "true",
                "_lib": "5",
                "_log_count": "0",
                "_page_title": "",
                "_province": "bj",
                "_referrer_title": "",
                "_screen_height": "800",
                "_screen_width": "360",
                "_sdk_type": "unity",
                "_source_type": "sdk",
                "_sub_lib_version": "1.0.1.0",
                "_type": "event",
                "ecpm_rate": "1",
                "ip_upload": "111.203.237.82",
                "random_user_id": "2998000746001017891",
                "se_pro_id": "787"
            },
            "device_id": "",
            "device_id_type": "",
            "install_time": "1727335959338",
            "integration_type": "sdk",
            "ipv4": "111.203.237.82",
            "language": "zh_CN",
            "model": "JEF-AN20",
            "openid": "",
            "os": "android",
            "os_version": "31",
            "query_info": {
                "gsid": ""
            },
            "report_time": "1727335958766",
            "scene_id": "other",
            "unionid": "",
            "result": "organic"
}
  

Mini-Game:

ParameterExampleDescription
app_platformminigamePlatform of the app
app_type Platform type:wechat、douyin
appkey Appkey in the SolarEngine backend
attribution_method Attribution method: Passthrough Attribution (URL), Click Attribution (click)
brandHUAWEIDevice Vendor
channel_id-1Channel ID
channel_nameorganicAttribution channel name
collector_version1.0.1.0Collector version
container_name Host App Name, Douyin Exclusive
countryCNCountry
current_event_time Current Event Time
custom_params Event custom parameter nesting
device_id Attribution device unique ID
device_id_type Device ID type
install_time1727335959338Install time
integration_typesdkIntegration method. Fixed as 'sdk'.
ipv4111.203.237.82User public network IP v4 version
languagezh_CNDevice Language
modelJEF-AN20Device Model
openid Unique user ID within the current mini-program
osandroidHost App Operating System Platform
os_version31Host App Operating System Version
query_info Query information obtained from the mini-program platform, SE carried parameters + channel additional parameters
report_time1727335958766Time received by the server
scene_idotherScene Value
unionid Douyin exclusive, unique anonymous user ID within the current mini-program
resultorganic








Previous
Unity SDK
Next
Mini-Game Platform Backend Configuration
Last modified: 2026-09-20Powered by