From 017aa5de36a80d01843d907bfb4471cd2e768c87 Mon Sep 17 00:00:00 2001 From: juncong lee Date: Wed, 10 Sep 2025 17:52:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0idid=EF=BC=8C=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=B1=9E=E6=80=A7=EF=BC=8C=E5=85=AC=E5=85=B1=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=EF=BC=8C=E6=B7=BB=E5=8A=A0register=5Ftime=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SDKManager/AdjustManager/AdjustManager.cs | 7 +++- .../SDKManager/ShuShuMangage/ShuShuEvent.cs | 33 +++++++++++-------- .../SDKManager/ShuShuMangage/ShuShuMangage.cs | 7 +++- 3 files changed, 32 insertions(+), 15 deletions(-) diff --git a/Assets/Script/SDKManager/AdjustManager/AdjustManager.cs b/Assets/Script/SDKManager/AdjustManager/AdjustManager.cs index 6780e33..76400ab 100644 --- a/Assets/Script/SDKManager/AdjustManager/AdjustManager.cs +++ b/Assets/Script/SDKManager/AdjustManager/AdjustManager.cs @@ -18,7 +18,7 @@ public class AdjustManager : D_MonoSingleton private string callbackNetwork = ""; bool m_start = false; private int callGetTimes = 0; - + public void Init() { //开始计时 @@ -41,6 +41,11 @@ public class AdjustManager : D_MonoSingleton ShuShuEvent.Instance.Track("adjust_init"); FireBaseAnalyticsManager.Instance.LogEvent("adjust_init"); + Adjust.GetAdid((id)=> + { + ShuShuEvent.Instance.SetSuperProperties(new Dictionary() { { "adid", id } }); + ShuShuEvent.Instance.UserSet(new Dictionary() { { "adid", id } }); + }); } diff --git a/Assets/Script/SDKManager/ShuShuMangage/ShuShuEvent.cs b/Assets/Script/SDKManager/ShuShuMangage/ShuShuEvent.cs index 60477c8..8ad3e92 100644 --- a/Assets/Script/SDKManager/ShuShuMangage/ShuShuEvent.cs +++ b/Assets/Script/SDKManager/ShuShuMangage/ShuShuEvent.cs @@ -10,10 +10,17 @@ namespace WZ /// /// 设置用户属性 /// - public void UserSet(Dictionary dic) + public void UserSet(Dictionary dic,bool setOnce = false) { LoggerUtils.Debug("[shushu] userset:"+JsonMapper.ToJson(dic)); - TDAnalytics.UserSet(dic); + if (setOnce) + { + TDAnalytics.UserSetOnce(dic); + } + else + { + TDAnalytics.UserSet(dic); + } } /// @@ -80,17 +87,17 @@ namespace WZ /// 第几次展示该格式的广告 public void OnAdRevenueEvent(string ad_platform, string ad_source, string ad_unit_name, string ad_format, double revenue, string position, int number) { - Dictionary properties = new Dictionary(); - properties.Add("ad_platform", ad_platform); - properties.Add("ad_source", ad_source); - properties.Add("ad_unit_name", ad_unit_name); - properties.Add("ad_format", ad_format); - properties.Add("value", revenue); - properties.Add("currency", "USD"); - properties.Add("position", position); - properties.Add("number", number); - - TDAnalytics.Track("ad_impression", properties); + TDAnalytics.Track("ad_impression", new Dictionary + { + { "ad_platform", ad_platform }, + { "ad_source", ad_source }, + { "ad_unit_name", ad_unit_name }, + { "ad_format", ad_format }, + { "value", revenue }, + { "currency", "USD" }, + { "position", position }, + { "number", number } + }); } } } \ No newline at end of file diff --git a/Assets/Script/SDKManager/ShuShuMangage/ShuShuMangage.cs b/Assets/Script/SDKManager/ShuShuMangage/ShuShuMangage.cs index 6b887ca..a4c5c0c 100644 --- a/Assets/Script/SDKManager/ShuShuMangage/ShuShuMangage.cs +++ b/Assets/Script/SDKManager/ShuShuMangage/ShuShuMangage.cs @@ -1,3 +1,4 @@ +using System; using System.Collections; using System.Collections.Generic; using AdjustSdk; @@ -14,7 +15,11 @@ namespace WZ TDAnalytics.Init(StaticValue.TDAppID, StaticValue.TDServerURL); //开启自动采集事件 TDAnalytics.EnableAutoTrack(TDAutoTrackEventType.AppInstall | TDAutoTrackEventType.AppStart | TDAutoTrackEventType.AppEnd); + + ShuShuEvent.Instance.UserSet(new Dictionary + { + { "register_timestamp", DateTimeOffset.UtcNow.ToUnixTimeSeconds() } + },true); } - } } \ No newline at end of file