update: GuruSDK 内部不再调用 SetUserProperty
Signed-off-by: huyufei <yufei.hu@castbox.fm>
parent
d22322ee26
commit
dda2cf118e
|
|
@ -132,7 +132,9 @@ namespace Guru
|
|||
public const string PropertyGDPR = "gdpr"; // GDPR状态
|
||||
public const string PropertySignUpMethod = "sign_up_method"; // 用户登录方式
|
||||
public const string PropertyFirebaseId = "firebase_id"; // FirebaseID
|
||||
public const string PropertyGoogleAdId = "ad_id"; // FirebaseID
|
||||
public const string PropertyGoogleAdId = "ad_id"; // Google AdId
|
||||
public const string PropertyAnalyticsExperimentalGroup = "guru_analytics_exp"; // Analytics Experimental Group
|
||||
|
||||
|
||||
public static HashSet<string> PredefinedMidWareProperties = new HashSet<string>()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ namespace Guru
|
|||
{
|
||||
OnGuruAnalyticsInitComplete();
|
||||
Debug.Log($"{TAG} [guru_analytic]--- Guru EXP: GroupId: {GuruAnalytics.Instance.ExperimentGroupId}");
|
||||
SetUserProperty(GuruAnalyticsConfigManager.KEY_GURU_ANALYTICS_EXP, GuruAnalytics.Instance.ExperimentGroupId);
|
||||
SetAnalyticsExperimentGroup(GuruAnalytics.Instance.ExperimentGroupId);
|
||||
ApplyAllMidWareProperties();
|
||||
}, IsDebug, firebaseId); // Android 初始化
|
||||
|
||||
|
|
|
|||
|
|
@ -72,7 +72,41 @@ namespace Guru
|
|||
{
|
||||
MidWarePropertiesManager.Instance.ReportUid(uid);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置用户ID
|
||||
/// </summary>
|
||||
public static void SetBLevel(int bLevel)
|
||||
{
|
||||
MidWarePropertiesManager.Instance.ReportBLevel($"{bLevel}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置用户ID
|
||||
/// </summary>
|
||||
public static void SetBPlay(int bPlay)
|
||||
{
|
||||
MidWarePropertiesManager.Instance.ReportBPlay($"{bPlay}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置Analytics 实验分组
|
||||
/// (Firebase, Guru)
|
||||
/// </summary>
|
||||
private static void SetAnalyticsExperimentGroup(string groupName)
|
||||
{
|
||||
MidWarePropertiesManager.Instance.ReportAnalyticsExperimentGroup(groupName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置账号登录方法
|
||||
/// (Firebase, Guru)
|
||||
/// </summary>
|
||||
internal static void SetSignUpMethod(string methodName)
|
||||
{
|
||||
MidWarePropertiesManager.Instance.ReportSignUpMethod(methodName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置设备ID
|
||||
/// (Firebase, Guru)
|
||||
|
|
@ -241,6 +275,64 @@ namespace Guru
|
|||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// BLevel
|
||||
/// </summary>
|
||||
private class MidWarePropertyBLevel : AbstractMidWareProperty
|
||||
{
|
||||
public MidWarePropertyBLevel(string value)
|
||||
: base(PropertyLevel, value, ReportPropertyTarget.Both)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void BeforeReportProperty()
|
||||
{
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// BLevel
|
||||
/// </summary>
|
||||
private class MidWarePropertyBPlay : AbstractMidWareProperty
|
||||
{
|
||||
public MidWarePropertyBPlay(string value)
|
||||
: base(PropertyPlay, value, ReportPropertyTarget.Both)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void BeforeReportProperty()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// SignUpMethod
|
||||
/// </summary>
|
||||
private class MidWarePropertySignUpMethod : AbstractMidWareProperty
|
||||
{
|
||||
public MidWarePropertySignUpMethod(string value)
|
||||
: base(PropertySignUpMethod, value, ReportPropertyTarget.Both)
|
||||
{
|
||||
|
||||
}
|
||||
protected override void BeforeReportProperty()
|
||||
{
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// AnalyticsExperimentGroup
|
||||
/// </summary>
|
||||
private class MidWarePropertyAnalyticsExperimentGroup : AbstractMidWareProperty
|
||||
{
|
||||
public MidWarePropertyAnalyticsExperimentGroup(string value)
|
||||
: base(PropertyAnalyticsExperimentalGroup, value, ReportPropertyTarget.Both)
|
||||
{
|
||||
|
||||
}
|
||||
protected override void BeforeReportProperty()
|
||||
{
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// DeviceId
|
||||
/// </summary>
|
||||
private class MidWarePropertyDeviceId : AbstractMidWareProperty
|
||||
|
|
@ -475,7 +567,33 @@ namespace Guru
|
|||
_propertyMap.TryAdd(prop.key, prop);
|
||||
prop.Report();
|
||||
}
|
||||
public void ReportBLevel(string bLevel)
|
||||
{
|
||||
var prop = new MidWarePropertyBLevel(bLevel);
|
||||
_propertyMap.TryAdd(prop.key, prop);
|
||||
prop.Report();
|
||||
}
|
||||
public void ReportBPlay(string bPlay)
|
||||
{
|
||||
var prop = new MidWarePropertyBPlay(bPlay);
|
||||
_propertyMap.TryAdd(prop.key, prop);
|
||||
prop.Report();
|
||||
}
|
||||
|
||||
public void ReportAnalyticsExperimentGroup(string groupName)
|
||||
{
|
||||
var prop = new MidWarePropertyAnalyticsExperimentGroup(groupName);
|
||||
_propertyMap.TryAdd(prop.key, prop);
|
||||
prop.Report();
|
||||
}
|
||||
|
||||
public void ReportSignUpMethod(string methodName)
|
||||
{
|
||||
var prop = new MidWarePropertySignUpMethod(methodName);
|
||||
_propertyMap.TryAdd(prop.key, prop);
|
||||
prop.Report();
|
||||
}
|
||||
|
||||
public void ReportDeviceId(string deviceId)
|
||||
{
|
||||
var prop = new MidWarePropertyDeviceId(deviceId);
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ namespace Guru
|
|||
FirebaseAnalytics.SetSessionTimeoutDuration(new TimeSpan(0, 30, 0));
|
||||
|
||||
// --- 上报用户事件 ---
|
||||
SetUserProperty(PropertyDeviceID, IPMConfig.IPM_DEVICE_ID);
|
||||
SetDeviceId(IPMConfig.IPM_DEVICE_ID);
|
||||
// SetUserProperty(PropertyFirstOpenTime, FirstOpenTime);
|
||||
|
||||
_firebaseEventDriver.TriggerFlush();
|
||||
|
|
@ -158,6 +158,7 @@ namespace Guru
|
|||
Crashlytics.SetUserId(uid);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 设置用户属性
|
||||
/// </summary>
|
||||
|
|
@ -194,10 +195,9 @@ namespace Guru
|
|||
Debug.Log($"Catch Error: {ex}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -78,7 +78,8 @@ namespace Guru
|
|||
bool success = FirebaseUser != null;
|
||||
onLoginResult?.Invoke(success);
|
||||
_retryDelayTime = LOGIN_RETRY_INTERVAL;
|
||||
Analytics.SetUserProperty(Analytics.PropertySignUpMethod, "google"); // 上报用户登录属性
|
||||
|
||||
Analytics.SetSignUpMethod("google"); // 上报用户登录属性
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -923,7 +923,7 @@ namespace Guru
|
|||
{
|
||||
Instance._model.SetIsIapUser(value); // 用户属性
|
||||
}
|
||||
Analytics.SetUserProperty(Analytics.PropertyIsIAPUser, value ? "true" : "false");
|
||||
Analytics.SetIsIapUser(value);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue