// // StatisticsServiceHelper.m // xplan-ios // // Created by 冯硕 on 2021/9/27. // #import "StatisticsServiceHelper.h" #import "StatisticsService.h" @implementation StatisticsServiceHelper NSString *const StatisticsServiceEventAppLaunch = @"app_launch"; #pragma mark - 登录模块的 NSString *const StatisticsServiceEventOneClickLoginSuccess = @"one_click_login_succeed"; NSString *const StatisticsServiceEventLoginPhoneClick = @"login_phone_click"; NSString *const StatisticsServiceEventLoginQQClick = @"login_qq_click";///QQ登录 NSString *const StatisticsServiceEventLoginWXClick = @"login_wx_click";///wx登录 NSString *const StatisticsServiceEventLoginRepariSuccess = @"login_repari_success";///注册个人资料保存成功 #pragma mark - 贵族 NSString *const StatisticsServiceEventVipOpenClick = @"vip_open_click";///开通贵族点击 NSString *const StatisticsServiceEventvipEntranceRoomClick = @"vip_entrance_room_click";///贵族房间入口点击 NSString *const StatisticsServiceEventvipEntranceGiftClick = @"vip_entrance_gift_click";///贵族礼物面板入口点击 NSString *const StatisticsServiceEventvipEntranceFaceClick = @"vip_entrance_face_click";///贵族表情面板入口点击 NSString *const StatisticsServiceEventvipEntranceMeClick = @"vip_entrance_me_click";///贵族我的页面入口点击 #pragma mark - 首页直播模块 NSString *const StatisticsServiceEventRecent_card_show = @"recent_card_show";///最近在看卡片曝光 NSString *const StatisticsServiceEventRecent_card_click = @"recent_card_click";///最近在看卡片点击 NSString *const StatisticsServiceEventGebo_tab_click = @"gebo_tab_click";///个播页二级tab分类点击 #pragma mark - 礼物 NSString *const StatisticsServiceEventRoomNugivePopShow = @"room_nugive_pop_show"; ///房间礼物赠送弹窗曝光 NSString *const StatisticsServiceEventRoomNugivePopClick = @"room_nugive_pop_click"; ///房间礼物赠送弹窗关闭 NSString *const StatisticsServiceEventNugiftPopShow = @"nugift_pop_show"; ///新人专享礼物弹窗曝光(不统计后续个人中心入口的曝光) NSString *const StatisticsServiceEventNugiftPopClick = @"nugift_pop_click"; ///新人专享礼物弹窗充值点击,点击时统计用户所选择的购买档位,(需统计后续个人中心入口的点击) NSString *const StatisticsServiceEventnugift_pop_finish_click = @"nugift_pop_finish_click"; ///新人专享礼物充值成功后弹窗(需统计对应充值tab档位) NSString *const StatisticsServiceEventNugiftPopCloseClick = @"nugift_pop_close_click"; ///新人专享礼物弹窗关闭点击 NSString *const StatisticsServiceEventUsercenterNugiftPopShow = @"usercenter_nugift_pop_show"; ///新人专享礼物入口曝光 NSString *const StatisticsServiceEventUsercenterNugiftPopClick = @"usercenter_nugift_pop_click"; ///新人专享礼物入口点击 NSString *const StatisticsServiceEventPersonalshowTopCardShow = @"personalshow_top_card_show"; ///个播展示卡片曝光 NSString *const StatisticsServiceEventPersonalshowTopCardRoomClick = @"personalshow_top_card_room_click"; ///个播展示卡片进入房间点击,点击时统计房间id NSString *const StatisticsServiceEventPersonalshowTopCardVoiceClick = @"personalshow_top_card_voice_click"; ///个播展示卡片播放语音点击 #pragma mark - 个人中心 NSString *const StatisticsServiceEventusercenter_recharge_card_show = @"usercenter_recharge_card_show"; ///个人中心充值卡片曝光 NSString *const StatisticsServiceEventusercenter_recharge_card_click = @"usercenter_recharge_card_click"; ///个人中心充值卡片点击(跳转充值页) NSString *const StatisticsServiceEventusercenter_noble_card_show = @"usercenter_noble_card_show"; ///个人中心贵族卡片曝光 NSString *const StatisticsServiceEventusercenter_noble_card_click = @"usercenter_noble_card_click";///个人中心贵族卡片片点击(跳转贵族页) NSString *const StatisticsServiceEventusercenter_function_show = @"usercenter_function_show"; ///个人中心功能板块曝光,曝光时统计功能的名称 NSString *const StatisticsServiceEventusercenter_function_click = @"usercenter_function_click"; ///个人中心功能板块点击,点击时统计功能的名称 NSString *const StatisticsServiceEventusercenter_quick_entry_show = @"usercenter_quick_entry_show"; ///个人中心快捷进房曝光,曝光时统计房间的id NSString *const StatisticsServiceEventusercenter_quick_entrysuccess_click = @"usercenter_quick_entrysuccess_click"; ///个人中心快捷进房点击成功匹配,点击时统计房间的id NSString *const StatisticsServiceEventusercenter_quick_entry_click = @"usercenter_quick_entry_click"; ///个人中心快捷进房点击未匹配成功,点击时统计房间的id NSString *const StatisticsServiceEventusercenter_banner_show = @"usercenter_banner_show"; ///个人中心banner模块曝光,曝光时统计banner的id NSString *const StatisticsServiceEventusercenter_banner_click = @"usercenter_banner_click"; ///个人中心banner模块点击,点击时统计banner的id #pragma mark - 活动任务 NSString *const StatisticsServiceEventtask_toast_show = @"task_toast_show"; ///任务完成toast曝光 NSString *const StatisticsServiceEventtask_toast_click = @"task_toast_click"; ///任务完成toast点击(跳转活动页 /// 埋点事件 /// @param eventKey key + (void)trackEventWithKey:(NSString *)eventKey { [self trackEventWithKey:eventKey eventAttributes:nil]; } /// 埋点事件带参数 /// @param eventKey key /// @param eventAttributes 参数 + (void)trackEventWithKey:(NSString *)eventKey eventAttributes:(NSDictionary * _Nullable)eventAttributes { [StatisticsService trackEvent:eventKey eventDescribe:[self getTrackEventDescripWithKey:eventKey] eventAttributes:eventAttributes]; } /// 统计时长 开始 /// @param eventKey key + (void)trackEventStartWithKey:(NSString *)eventKey { [StatisticsService trackEvent:eventKey eventStart:[self getTrackEventDescripWithKey:eventKey]]; } /// 统计时长 结束 /// @param eventKey key + (void)trackEventEndWithKey:(NSString *)eventKey { [StatisticsService trackEvent:eventKey eventEnd:[self getTrackEventDescripWithKey:eventKey]]; } ///埋点 只需要在这个里面 进行相应的配置 即可 key 和descrip + (NSString *)getTrackEventDescripWithKey:(NSString *)key { NSDictionary * dic = @{ StatisticsServiceEventAppLaunch:@"应用启动", StatisticsServiceEventOneClickLoginSuccess:@"一键登录成功", StatisticsServiceEventLoginPhoneClick:@"手机登录", StatisticsServiceEventLoginQQClick:@"qq登录", StatisticsServiceEventLoginWXClick:@"微信登录", StatisticsServiceEventLoginRepariSuccess:@"注册时候的个人资料保存成功", StatisticsServiceEventVipOpenClick:@"开通贵族点击", StatisticsServiceEventvipEntranceRoomClick:@"贵族房间入口点击", StatisticsServiceEventvipEntranceGiftClick:@"贵族礼物面板入口点击", StatisticsServiceEventvipEntranceFaceClick:@"贵族表情面板入口点击", StatisticsServiceEventvipEntranceMeClick:@"贵族我的页面入口点击" }; NSString * decription = [dic objectForKey:StatisticsServiceEventAppLaunch]; return decription; } @end