事件打点

This commit is contained in:
juncong lee 2026-01-07 16:02:54 +08:00
parent 471fc37d47
commit c430118753
2 changed files with 42 additions and 2 deletions

View File

@ -17,6 +17,31 @@ using WZ;
public class RushSDKManager : D_MonoSingleton<RushSDKManager> public class RushSDKManager : D_MonoSingleton<RushSDKManager>
{ {
#region Loading events
private float _loadingStartTime;
private float _loadingEndTime;
public void StartLoading()
{
_loadingStartTime = Time.time;
Invoke(nameof(SendLoadingStartEvent),15);
}
public void LoadingEnd()
{
_loadingEndTime = Time.time - _loadingStartTime;
Invoke(nameof(SendLoadingEndEvent),15);
}
public void SendLoadingStartEvent()
{
LogEvent("loading_show");
}
public void SendLoadingEndEvent()
{
LogEvent("loading_end","pass_time",(int)_loadingEndTime);
}
#endregion
public static string GetSDKVersion() public static string GetSDKVersion()
{ {

View File

@ -16,6 +16,8 @@ namespace WZ
public Button _reqCancelBtn; public Button _reqCancelBtn;
public Button _boostBtn; public Button _boostBtn;
public Button _boostCancelBtn; public Button _boostCancelBtn;
private string _eventValue;
private string _currentPage;
public void Awake() public void Awake()
{ {
@ -25,13 +27,17 @@ namespace WZ
_boostCancelBtn.onClick.AddListener(StayCancalBtnClick); _boostCancelBtn.onClick.AddListener(StayCancalBtnClick);
} }
public void ReqVpnBtnClick() public void ReqVpnBtnClick()
{ {
LoggerUtils.Debug("ReqVpnBtnClick"); LoggerUtils.Debug("ReqVpnBtnClick");
RushSDKManager.Instance.LogEvent("v_guide_click","entrance",_eventValue);
TransferAndroidClass.RequestVpnPermission((res, msg) => TransferAndroidClass.RequestVpnPermission((res, msg) =>
{ {
TransferData.HasReqVpnPermission = true; TransferData.HasReqVpnPermission = true;
RushSDKManager.Instance.LogEvent("v_auth_success","page",_currentPage);
ClosePopup(); ClosePopup();
LoggerUtils.Debug($"VPN权限请求结果: {res}, 消息: {msg}"); LoggerUtils.Debug($"VPN权限请求结果: {res}, 消息: {msg}");
}); });
@ -40,15 +46,19 @@ namespace WZ
public void ReqVpnCancelBtnClick() public void ReqVpnCancelBtnClick()
{ {
LoggerUtils.Debug("ReqVpnCancelBtnClick"); LoggerUtils.Debug("ReqVpnCancelBtnClick");
_currentPage = "v_retetion";
RushSDKManager.Instance.LogEvent("v_retention_view","entrance",_eventValue);
_stayObj.gameObject.SetActive(true); _stayObj.gameObject.SetActive(true);
} }
public void StayBtnClick() public void StayBtnClick()
{ {
LoggerUtils.Debug("StayBtnClick"); LoggerUtils.Debug("StayBtnClick");
RushSDKManager.Instance.LogEvent("v_retention_click","entrance",_eventValue);
TransferAndroidClass.RequestVpnPermission((res, msg) => TransferAndroidClass.RequestVpnPermission((res, msg) =>
{ {
TransferData.HasReqVpnPermission = true; TransferData.HasReqVpnPermission = true;
RushSDKManager.Instance.LogEvent("v_auth_success","page",_currentPage);
ClosePopup(); ClosePopup();
LoggerUtils.Debug($"VPN权限请求结果: {res}, 消息: {msg}"); LoggerUtils.Debug($"VPN权限请求结果: {res}, 消息: {msg}");
}); });
@ -57,14 +67,19 @@ namespace WZ
public void StayCancalBtnClick() public void StayCancalBtnClick()
{ {
LoggerUtils.Debug("StayCancalBtnClick"); LoggerUtils.Debug("StayCancalBtnClick");
RushSDKManager.Instance.LogEvent("v_retention_close","entrance",_eventValue);
ClosePopup(); ClosePopup();
} }
public void ShowConnectionRequest(Action onConfirm = null) public void ShowConnectionRequest(bool afterLoading,int level)
{ {
if(TransferData.HasShowedReqVpnPermissionView) return; if(TransferData.HasShowedReqVpnPermissionView) return;
var eventValue = afterLoading ? "after_loading" : "level_"+level.ToString();
_eventValue = eventValue;
_currentPage = "v_guide";
RushSDKManager.Instance.LogEvent("v_guide_view","entrance",eventValue);
LoggerUtils.Debug("ShowConnectionRequest"); LoggerUtils.Debug("ShowConnectionRequest");
TransferData.HasShowedReqVpnPermissionView = true; TransferData.HasShowedReqVpnPermissionView = true;
_contentReqPrefab = Resources.Load<GameObject>("Prefabs/PermissionRequest"); _contentReqPrefab = Resources.Load<GameObject>("Prefabs/PermissionRequest");