parent
							
								
									bb3a1310b3
								
							
						
					
					
						commit
						8ea0171247
					
				|  | @ -1,3 +1,5 @@ | |||
| using JetBrains.Annotations; | ||||
| 
 | ||||
| namespace Guru | ||||
| { | ||||
| 	using System; | ||||
|  | @ -153,8 +155,8 @@ namespace Guru | |||
| 				dict[ParameterStep] = step.Value; | ||||
| 			if(score != null) | ||||
| 				dict[ParameterScore] = score.Value; | ||||
| 			 | ||||
| 			if(extra != null) dict.AddRange(extra, isOverride:true); | ||||
| 			if(extra != null)  | ||||
| 				dict.AddRange(extra, isOverride:true); | ||||
| 
 | ||||
| 			LogEvent(EventLevelEnd, dict); | ||||
| 
 | ||||
|  | @ -162,7 +164,7 @@ namespace Guru | |||
| 			{ | ||||
| 				int lv = BPlay; | ||||
| 				if (lv == 0) lv = level; | ||||
| 				LevelEndSuccess(itemCategory, lv, itemID); | ||||
| 				LevelEndSuccess(lv, itemCategory, itemID); | ||||
| 			} | ||||
| 		} | ||||
| 
 | ||||
|  | @ -173,28 +175,29 @@ namespace Guru | |||
| 		/// <param name="level"></param> | ||||
| 		/// <param name="result"></param> | ||||
| 		/// <param name="levelName"></param> | ||||
| 		/// <param name="itemCategory"></param> | ||||
| 		/// <param name="itemId"></param> | ||||
| 		/// <param name="levelType"></param> | ||||
| 		/// <param name="puzzleId"></param> | ||||
| 		/// <param name="duration"></param> | ||||
| 		/// <param name="step"></param> | ||||
| 		/// <param name="score"></param> | ||||
| 		/// <param name="extra"></param> | ||||
| 		public static void LogLevelEnd(int level, string result,  | ||||
| 			string levelName = "", string itemCategory = "main", string itemId = "",  | ||||
| 			string levelName = "", string levelType = "main", string puzzleId = "",  | ||||
| 			int? duration = null, int? step = null, int? score = null, Dictionary<string, object> extra = null) | ||||
| 		{ | ||||
| 			bool isSuccess = result.Equals("success"); | ||||
| 			 | ||||
| 			var dict = new Dictionary<string, object>() | ||||
| 			{ | ||||
| 				{ ParameterItemCategory, itemCategory }, | ||||
| 				{ ParameterItemId, itemId }, | ||||
| 				{ ParameterItemCategory, levelType }, | ||||
| 				{ ParameterLevelName, levelName }, | ||||
| 				{ ParameterLevel, level }, | ||||
| 				{ ParameterSuccess,  isSuccess ? "true" : "false" }, | ||||
| 				{ ParameterResult, result }, | ||||
| 			}; | ||||
| 
 | ||||
| 			if(!string.IsNullOrEmpty(puzzleId)) | ||||
| 				dict[ParameterItemId] = puzzleId; | ||||
| 			if (duration != null) | ||||
| 				dict[ParameterDuration] = duration.Value; | ||||
| 			if(step != null) | ||||
|  | @ -210,7 +213,7 @@ namespace Guru | |||
| 			{ | ||||
| 				int lv = BPlay; | ||||
| 				if (lv == 0) lv = level; | ||||
| 				LevelEndSuccess(itemCategory, lv, itemId); | ||||
| 				LevelEndSuccess(lv, levelType, puzzleId); | ||||
| 			} | ||||
| 		} | ||||
| 
 | ||||
|  | @ -219,10 +222,10 @@ namespace Guru | |||
| 		/// <summary> | ||||
| 		/// 新用户通过第几关(仅记录前n关,根据项目自行确定,不区分关卡类型)[买量用] | ||||
| 		/// </summary> | ||||
| 		/// <param name="itemCategory"></param> | ||||
| 		/// <param name="levelType"></param> | ||||
| 		/// <param name="level">关卡(从1开始)</param> | ||||
| 		/// /// <param name="itemID">棋局id /图片id</param> | ||||
| 		public static void LevelEndSuccess(string itemCategory, int level, string itemID) | ||||
| 		/// /// <param name="puzzleId">棋局id /图片id</param> | ||||
| 		public static void LevelEndSuccess( int level, string levelType, string puzzleId) | ||||
| 		{ | ||||
| 			if (level > GuruSettings.Instance.AnalyticsSetting.LevelEndSuccessNum) | ||||
| 				return; | ||||
|  | @ -230,8 +233,9 @@ namespace Guru | |||
| 			string eventName = $"level_end_success_{level}"; | ||||
| 			LogEvent(eventName,new Dictionary<string, object>() | ||||
| 			{ | ||||
| 				{ ParameterItemId, itemID }, | ||||
| 				{ ParameterItemCategory, itemCategory} | ||||
| 				{ ParameterLevel, level }, | ||||
| 				{ ParameterItemId, puzzleId }, | ||||
| 				{ ParameterItemCategory, levelType} | ||||
| 			}); | ||||
| 		} | ||||
| 		 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue