Ta android + ios
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using ThinkingData.Analytics;
|
||||
using tysdk;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
@@ -24,6 +26,8 @@ public class SDKTest : MonoBehaviour
|
||||
[SerializeField]
|
||||
private Button _gaAppMaxBtn;
|
||||
[SerializeField]
|
||||
private Button _taBtn;
|
||||
[SerializeField]
|
||||
private Text _messageTxt;
|
||||
|
||||
void Start()
|
||||
@@ -38,6 +42,7 @@ public class SDKTest : MonoBehaviour
|
||||
_payListBtn.onClick.AddListener(OnPayListBtn);
|
||||
_gaTestBtn.onClick.AddListener(OnGaBtn);
|
||||
_gaAppMaxBtn.onClick.AddListener(OnAppMaxBtn);
|
||||
_taBtn.onClick.AddListener(OnTaBtn);
|
||||
}
|
||||
|
||||
private async void OnLogin(EAccoutType accoutType)
|
||||
@@ -91,4 +96,31 @@ public class SDKTest : MonoBehaviour
|
||||
// TYSdkFacade.Instance.PlayAd();
|
||||
}
|
||||
|
||||
public void OnTaBtn()
|
||||
{
|
||||
// 初始化SDK
|
||||
TDAnalytics.Init("0caf287574bd4a9bb08be8995705ef6f", "https://122-slg-online01.qijihdhk.com:8991");
|
||||
// //如果用户已登录,可以设置用户的账号ID作为身份唯一标识
|
||||
// TDAnalytics.Login("TA");
|
||||
//设置公共事件属性以后,每个事件都会带有公共事件属性
|
||||
// Dictionary<string, object> superProperties = new Dictionary<string, object>();
|
||||
// superProperties["channel"] = "ta";//字符串
|
||||
// superProperties["age"] = 1;//数字
|
||||
// superProperties["isSuccess"] = true;//布尔
|
||||
// superProperties["birthday"] = DateTime.Now;//时间
|
||||
// superProperties["object"] = new Dictionary<string, object>(){{ "key", "value"}};//对象
|
||||
// superProperties["object_arr"] = new List<object>() {new Dictionary<string, object>(){{ "key", "value" }}};//对象组
|
||||
// superProperties["arr"] = new List<object>() { "value" };//数组
|
||||
// TDAnalytics.SetSuperProperties(superProperties);//设置公共事件属性
|
||||
//开启自动采集事件
|
||||
// TDAnalytics.EnableAutoTrack(TDAutoTrackEventType.AppInstall | TDAutoTrackEventType.AppStart | TDAutoTrackEventType.AppEnd);
|
||||
//发送事件
|
||||
// Dictionary<string, object> properties = new Dictionary<string, object>(){{"product_name", "商品名")}};
|
||||
// TDAnalytics.Track("product_buy", properties);
|
||||
//设置用户属性
|
||||
// TDAnalytics.UserSet(new Dictionary<string, object>(){{"user_name", "TA"}});
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user