添加idid,用户属性,公共属性,添加register_time用户属性

This commit is contained in:
juncong lee 2025-09-10 17:52:33 +08:00
parent f4a1f2e1e2
commit 017aa5de36
3 changed files with 32 additions and 15 deletions

View File

@ -41,6 +41,11 @@ public class AdjustManager : D_MonoSingleton<AdjustManager>
ShuShuEvent.Instance.Track("adjust_init");
FireBaseAnalyticsManager.Instance.LogEvent("adjust_init");
Adjust.GetAdid((id)=>
{
ShuShuEvent.Instance.SetSuperProperties(new Dictionary<string, object>() { { "adid", id } });
ShuShuEvent.Instance.UserSet(new Dictionary<string, object>() { { "adid", id } });
});
}

View File

@ -10,11 +10,18 @@ namespace WZ
/// <summary>
/// 设置用户属性
/// </summary>
public void UserSet(Dictionary<string, object> dic)
public void UserSet(Dictionary<string, object> dic,bool setOnce = false)
{
LoggerUtils.Debug("[shushu] userset:"+JsonMapper.ToJson(dic));
if (setOnce)
{
TDAnalytics.UserSetOnce(dic);
}
else
{
TDAnalytics.UserSet(dic);
}
}
/// <summary>
/// 设置公共事件属性
@ -80,17 +87,17 @@ namespace WZ
/// <param name="number">第几次展示该格式的广告</param>
public void OnAdRevenueEvent(string ad_platform, string ad_source, string ad_unit_name, string ad_format, double revenue, string position, int number)
{
Dictionary<string, object> properties = new Dictionary<string, object>();
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<string, object>
{
{ "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 }
});
}
}
}

View File

@ -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<string, object>
{
{ "register_timestamp", DateTimeOffset.UtcNow.ToUnixTimeSeconds() }
},true);
}
}
}