update: 更新打点参数和打点库逻辑
--story=1020273 --user=yufei.hu 【中台】【BI】 中台打点标准化, 更新原有的打点和用户属性上报逻辑 https://www.tapd.cn/33527076/s/1147487hotfix/v1.0.12.2
parent
bc62aec38e
commit
0c4d6b31e9
|
|
@ -123,7 +123,7 @@ namespace Guru
|
||||||
/// <param name="extra">扩展数据</param>
|
/// <param name="extra">扩展数据</param>
|
||||||
public static void LogLevelEnd(int levelId, string result = EventLevelEndSuccess,
|
public static void LogLevelEnd(int levelId, string result = EventLevelEndSuccess,
|
||||||
string levelType = LevelTypeMain, string levelName = "", string puzzleId = "",
|
string levelType = LevelTypeMain, string levelName = "", string puzzleId = "",
|
||||||
int? duration = null, int? step = null, int? score = null, Dictionary<string, object> extra = null )
|
int duration = 0, int? step = null, int? score = null, Dictionary<string, object> extra = null )
|
||||||
{
|
{
|
||||||
if (!IsInitialSuccess)
|
if (!IsInitialSuccess)
|
||||||
{
|
{
|
||||||
|
|
@ -171,7 +171,7 @@ namespace Guru
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void LogLevelFail(int levelId,
|
public static void LogLevelFail(int levelId,
|
||||||
string levelType = LevelTypeMain, string levelName = "", string puzzleId = "",
|
string levelType = LevelTypeMain, string levelName = "", string puzzleId = "",
|
||||||
int? duration = null, int? step = null, int? score = null , Dictionary<string, object> extra = null)
|
int duration = 0, int? step = null, int? score = null , Dictionary<string, object> extra = null)
|
||||||
{
|
{
|
||||||
LogLevelEnd(levelId, EventLevelEndFail, levelType, levelName, puzzleId, duration, step, score, extra);
|
LogLevelEnd(levelId, EventLevelEndFail, levelType, levelName, puzzleId, duration, step, score, extra);
|
||||||
}
|
}
|
||||||
|
|
@ -181,7 +181,7 @@ namespace Guru
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void LogLevelFailExit(int levelId,
|
public static void LogLevelFailExit(int levelId,
|
||||||
string levelType = LevelTypeMain, string levelName = "", string puzzleId = "",
|
string levelType = LevelTypeMain, string levelName = "", string puzzleId = "",
|
||||||
int? duration = null, int? step = null, int? score = null, Dictionary<string, object> extra = null)
|
int duration = 0, int? step = null, int? score = null, Dictionary<string, object> extra = null)
|
||||||
{
|
{
|
||||||
LogLevelEnd(levelId, EventLevelEndExit, levelType, levelName, puzzleId, duration, step, score, extra);
|
LogLevelEnd(levelId, EventLevelEndExit, levelType, levelName, puzzleId, duration, step, score, extra);
|
||||||
}
|
}
|
||||||
|
|
@ -191,7 +191,7 @@ namespace Guru
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void LogLevelFailTimeout(int levelId,
|
public static void LogLevelFailTimeout(int levelId,
|
||||||
string levelType = LevelTypeMain, string levelName = "", string puzzleId = "",
|
string levelType = LevelTypeMain, string levelName = "", string puzzleId = "",
|
||||||
int? duration = null, int? step = null, int? score = null, Dictionary<string, object> extra = null)
|
int duration = 0, int? step = null, int? score = null, Dictionary<string, object> extra = null)
|
||||||
{
|
{
|
||||||
LogLevelEnd(levelId, EventLevelEndTimeout, levelType, levelName, puzzleId, duration, step, score, extra);
|
LogLevelEnd(levelId, EventLevelEndTimeout, levelType, levelName, puzzleId, duration, step, score, extra);
|
||||||
}
|
}
|
||||||
|
|
@ -286,17 +286,17 @@ namespace Guru
|
||||||
|
|
||||||
public static void SetUID(string uid)
|
public static void SetUID(string uid)
|
||||||
{
|
{
|
||||||
SetUserProperty(Analytics.PropertyUserID, uid);
|
SetUserProperty(Consts.PropertyUserID, uid);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SetUserBLevel(int blevel)
|
public static void SetUserBLevel(int blevel)
|
||||||
{
|
{
|
||||||
SetUserProperty(Analytics.PropertyLevel, $"{blevel}");
|
SetUserProperty(Consts.PropertyLevel, $"{blevel}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SetUserBPlay(int bplay)
|
public static void SetUserBPlay(int bplay)
|
||||||
{
|
{
|
||||||
SetUserProperty(Analytics.PropertyPlay, $"{bplay}");
|
SetUserProperty(Consts.PropertyPlay, $"{bplay}");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -305,7 +305,7 @@ namespace Guru
|
||||||
/// <param name="totalCoins"></param>
|
/// <param name="totalCoins"></param>
|
||||||
public static void SetUserTotalCoins(int totalCoins)
|
public static void SetUserTotalCoins(int totalCoins)
|
||||||
{
|
{
|
||||||
SetUserProperty(Analytics.PropertyCoin, $"{totalCoins}");
|
SetUserProperty(Consts.PropertyCoin, $"{totalCoins}");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -314,7 +314,7 @@ namespace Guru
|
||||||
/// <param name="freeCoins"></param>
|
/// <param name="freeCoins"></param>
|
||||||
public static void SetUserFreeCoins(int freeCoins)
|
public static void SetUserFreeCoins(int freeCoins)
|
||||||
{
|
{
|
||||||
SetUserProperty(Analytics.PropertyNonIAPCoin, $"{freeCoins}");
|
SetUserProperty(Consts.PropertyNonIAPCoin, $"{freeCoins}");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -323,27 +323,27 @@ namespace Guru
|
||||||
/// <param name="freeCoins"></param>
|
/// <param name="freeCoins"></param>
|
||||||
public static void SetUserPaidCoins(int paidCoins)
|
public static void SetUserPaidCoins(int paidCoins)
|
||||||
{
|
{
|
||||||
SetUserProperty(Analytics.PropertyIAPCoin, $"{paidCoins}");
|
SetUserProperty(Consts.PropertyIAPCoin, $"{paidCoins}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SetUserExp(int exp)
|
public static void SetUserExp(int exp)
|
||||||
{
|
{
|
||||||
SetUserProperty(Analytics.PropertyExp, $"{exp}");
|
SetUserProperty(Consts.PropertyExp, $"{exp}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SetUserHp(int hp)
|
public static void SetUserHp(int hp)
|
||||||
{
|
{
|
||||||
SetUserProperty(Analytics.PropertyHp, $"{hp}");
|
SetUserProperty(Consts.PropertyHp, $"{hp}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SetUserGrade(int grade)
|
public static void SetUserGrade(int grade)
|
||||||
{
|
{
|
||||||
SetUserProperty(Analytics.PropertyGrade, $"{grade}");
|
SetUserProperty(Consts.PropertyGrade, $"{grade}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SetUserIsIAP(bool isIapUser)
|
public static void SetUserIsIAP(bool isIapUser)
|
||||||
{
|
{
|
||||||
SetUserProperty(Analytics.PropertyIsIAPUser, isIapUser? "true" : "false");
|
SetUserProperty(Consts.PropertyIsIAPUser, isIapUser? "true" : "false");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SetFirstOpenTime(string timestamp)
|
public static void SetFirstOpenTime(string timestamp)
|
||||||
|
|
@ -351,6 +351,17 @@ namespace Guru
|
||||||
SetUserProperty(Analytics.PropertyFirstOpenTime, timestamp);
|
SetUserProperty(Analytics.PropertyFirstOpenTime, timestamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void SetNotiPerm(string status)
|
||||||
|
{
|
||||||
|
SetUserProperty(Consts.PropertyNotiPerm, status);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void SetATTStatus(string status)
|
||||||
|
{
|
||||||
|
SetUserProperty(Consts.PropertyATTStatus, status);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 初始化时调用一下所有的属性打点 </br>
|
/// 初始化时调用一下所有的属性打点 </br>
|
||||||
/// <a href="https://docs.google.com/spreadsheets/d/1N47rXgjatRHFvzWWx0Hqv5C1D9NHHGbggi6pQ65c-zQ/edit#gid=1858695240">用户属性文档</a>
|
/// <a href="https://docs.google.com/spreadsheets/d/1N47rXgjatRHFvzWWx0Hqv5C1D9NHHGbggi6pQ65c-zQ/edit#gid=1858695240">用户属性文档</a>
|
||||||
|
|
@ -395,11 +406,11 @@ namespace Guru
|
||||||
|
|
||||||
#if UNITY_IOS
|
#if UNITY_IOS
|
||||||
if(!HasUserPropertyKey(Consts.PropertyATTStatus))
|
if(!HasUserPropertyKey(Consts.PropertyATTStatus))
|
||||||
SetUserProperty(Consts.PropertyATTStatus, "notDetermined");
|
SetATTStatus("notDetermined"); // att_status
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(!HasUserPropertyKey(Consts.PropertyNotiPerm))
|
if(!HasUserPropertyKey(Consts.PropertyNotiPerm))
|
||||||
SetUserProperty(Consts.PropertyNotiPerm, "not_determined");
|
SetNotiPerm("not_determined"); // noti_perm
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -454,11 +465,11 @@ namespace Guru
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 当付费页面打开时调用
|
/// 当付费页面打开时调用 iap_imp
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="scene">付费页面名称, 默认为 Store</param>
|
/// <param name="scene">付费页场景名称</param>
|
||||||
/// <param name="productId">列表中首个商品的 ProductId </param>
|
/// <param name="productId">列表中首个商品的 ProductId </param>
|
||||||
public static void OnIAPPageOpen(string scene = "Store", string productId = "")
|
public static void OnIAPImp(string scene, string productId = "")
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(productId))
|
if (string.IsNullOrEmpty(productId))
|
||||||
{
|
{
|
||||||
|
|
@ -468,11 +479,11 @@ namespace Guru
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 当付费页面关闭时调用
|
/// 当付费页面关闭时调用 iap_close
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="scene"></param>
|
/// <param name="scene"></param>
|
||||||
/// <param name="productId"></param>
|
/// <param name="productId"></param>
|
||||||
public static void OnIAPPageClose(string scene = "Store", string productId = "")
|
public static void OnIAPClose(string scene, string productId = "")
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(productId))
|
if (string.IsNullOrEmpty(productId))
|
||||||
{
|
{
|
||||||
|
|
@ -483,7 +494,7 @@ namespace Guru
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 当点击 IAP 商品按钮的时候调用
|
/// 当点击 IAP 商品按钮的时候调用 iap_clk
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="scene"></param>
|
/// <param name="scene"></param>
|
||||||
/// <param name="productId"></param>
|
/// <param name="productId"></param>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue