SDK_UnityMoney/Assets/Script/SDKManager/ShuShuMangage/ShuShuMangage.cs

36 lines
1.6 KiB
C#
Raw Normal View History

2025-08-30 09:38:53 +00:00
using System.Collections;
using System.Collections.Generic;
2025-09-03 03:45:52 +00:00
using AdjustSdk;
2025-08-30 09:38:53 +00:00
using ThinkingData.Analytics;
using UnityEngine;
2025-09-01 10:32:50 +00:00
namespace WZ
2025-08-30 09:38:53 +00:00
{
2025-09-02 09:14:49 +00:00
public class ShuShuMangage : D_MonoSingleton<ShuShuMangage>
2025-08-30 09:38:53 +00:00
{
2025-09-01 10:32:50 +00:00
public void Init()
{
2025-09-03 03:45:52 +00:00
LoggerUtils.Debug("ShuShuMangage Init" + StaticValue.TDAppID + " serverURL" + StaticValue.TDServerURL);
2025-09-01 10:32:50 +00:00
// 初始化SDK
2025-09-02 09:50:19 +00:00
TDAnalytics.Init(StaticValue.TDAppID, StaticValue.TDServerURL);
2025-09-01 10:32:50 +00:00
//开启自动采集事件
TDAnalytics.EnableAutoTrack(TDAutoTrackEventType.AppInstall | TDAutoTrackEventType.AppStart | TDAutoTrackEventType.AppEnd);
//如果用户已登录可以设置用户的账号ID作为身份唯一标识
2025-09-02 12:27:05 +00:00
// TDAnalytics.Login("TA");
2025-09-03 07:02:42 +00:00
var userProperties = new Dictionary<string, object>();
userProperties.Add("ad_network", AdjustManager.GetAdNetwork());
userProperties.Add("campaign", AdjustManager.GetCampaign());
userProperties.Add("adgroup", AdjustManager.GetAdgroup());
userProperties.Add("creative", AdjustManager.GetCreative());
ShuShuEvent.Instance.UserSet(userProperties);
var publicProperties = new Dictionary<string, object>();
publicProperties.Add("user_ad_network", AdjustManager.GetAdNetwork());
publicProperties.Add("user_campaign", AdjustManager.GetCampaign());
publicProperties.Add("user_adgroup", AdjustManager.GetAdgroup());
publicProperties.Add("user_creative", AdjustManager.GetCreative());
AppSDKManager.Instance.SetSuperProperties(publicProperties);
2025-09-03 03:45:52 +00:00
2025-09-01 10:32:50 +00:00
}
}
}