新人充值、个人中心增加埋点

This commit is contained in:
chenguilong
2022-08-08 13:15:04 +08:00
parent c1f1c5b487
commit bbbdafe641
9 changed files with 104 additions and 0 deletions

View File

@@ -32,6 +32,35 @@ UIKIT_EXTERN NSString *const StatisticsServiceEventRecent_card_show;///最近在
UIKIT_EXTERN NSString *const StatisticsServiceEventRecent_card_click;///最近在看卡片点击
UIKIT_EXTERN NSString *const StatisticsServiceEventGebo_tab_click;///个播页二级tab分类点击
#pragma mark - 礼物
UIKIT_EXTERN NSString *const StatisticsServiceEventRoomNugivePopShow; ///房间礼物赠送弹窗曝光
UIKIT_EXTERN NSString *const StatisticsServiceEventRoomNugivePopClick; ///房间礼物赠送弹窗关闭
UIKIT_EXTERN NSString *const StatisticsServiceEventNugiftPopShow; ///新人专享礼物弹窗曝光(不统计后续个人中心入口的曝光)
UIKIT_EXTERN NSString *const StatisticsServiceEventNugiftPopClick; ///新人专享礼物弹窗充值点击,点击时统计用户所选择的购买档位,(需统计后续个人中心入口的点击)
UIKIT_EXTERN NSString *const StatisticsServiceEventnugift_pop_finish_click; ///新人专享礼物充值成功后弹窗需统计对应充值tab档位)
UIKIT_EXTERN NSString *const StatisticsServiceEventNugiftPopCloseClick; ///新人专享礼物弹窗关闭点击
UIKIT_EXTERN NSString *const StatisticsServiceEventUsercenterNugiftPopShow; ///新人专享礼物入口曝光
UIKIT_EXTERN NSString *const StatisticsServiceEventUsercenterNugiftPopClick; ///新人专享礼物入口点击
UIKIT_EXTERN NSString *const StatisticsServiceEventPersonalshowTopCardShow; ///个播展示卡片曝光
UIKIT_EXTERN NSString *const StatisticsServiceEventPersonalshowTopCardRoomClick; ///个播展示卡片进入房间点击,点击时统计房间id
UIKIT_EXTERN NSString *const StatisticsServiceEventPersonalshowTopCardVoiceClick; ///个播展示卡片播放语音点击
#pragma mark - 个人中心
UIKIT_EXTERN NSString *const StatisticsServiceEventusercenter_recharge_card_show; ///个人中心充值卡片曝光
UIKIT_EXTERN NSString *const StatisticsServiceEventusercenter_recharge_card_click; ///个人中心充值卡片点击(跳转充值页)
UIKIT_EXTERN NSString *const StatisticsServiceEventusercenter_noble_card_show; ///个人中心贵族卡片曝光
UIKIT_EXTERN NSString *const StatisticsServiceEventusercenter_noble_card_click;///个人中心贵族卡片片点击(跳转贵族页)
UIKIT_EXTERN NSString *const StatisticsServiceEventusercenter_function_show; ///个人中心功能板块曝光,曝光时统计功能的名称
UIKIT_EXTERN NSString *const StatisticsServiceEventusercenter_function_click; ///个人中心功能板块点击,点击时统计功能的名称
UIKIT_EXTERN NSString *const StatisticsServiceEventusercenter_quick_entry_show; ///个人中心快捷进房曝光,曝光时统计房间的id
UIKIT_EXTERN NSString *const StatisticsServiceEventusercenter_quick_entrysuccess_click; ///个人中心快捷进房点击成功匹配,点击时统计房间的
UIKIT_EXTERN NSString *const StatisticsServiceEventusercenter_quick_entry_click; ///个人中心快捷进房点击未匹配成功,点击时统计房间的id
UIKIT_EXTERN NSString *const StatisticsServiceEventusercenter_banner_show; ///个人中心banner模块曝光,曝光时统计banner的id
UIKIT_EXTERN NSString *const StatisticsServiceEventusercenter_banner_click; ///个人中心banner模块点击,点击时统计banner的id
#pragma mark - 活动任务
UIKIT_EXTERN NSString *const StatisticsServiceEventtask_toast_show; ///任务完成toast曝光
UIKIT_EXTERN NSString *const StatisticsServiceEventtask_toast_click; ///任务完成toast点击跳转活动页
///
/// 埋点事件
/// @param eventKey key

View File

@@ -28,6 +28,35 @@ 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,bannerid
NSString *const StatisticsServiceEventusercenter_banner_click = @"usercenter_banner_click"; ///banner,bannerid
#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 {

View File

@@ -8,6 +8,7 @@
#import "XPMinePresent.h"
///Tool
#import "AccountInfoStorage.h"
#import "StatisticsServiceHelper.h"
///Api
#import "Api+Mine.h"
#import "Api+Guild.h"
@@ -122,6 +123,7 @@
HomeLittleGameRoomModel *gameRoom = [HomeLittleGameRoomModel modelWithDictionary:data.data];
[[self getView] quickMatchLittleGameRoomSuccess:gameRoom mgId:mgId];
} fail:^(NSInteger code, NSString * _Nullable msg) {
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_quick_entry_click eventAttributes:@{@"mgId" : mgId}];
}] uid:uid mgId:mgId];
}

View File

@@ -120,6 +120,8 @@
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_recharge_card_show];
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_noble_card_show];
}
- (void)viewDidAppear:(BOOL)animated {
@@ -399,12 +401,14 @@
///
- (void)xpMineHeadViewClickAcount {
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_recharge_card_click];
[self pushViewControllerWithType:XPMineItemType_Account functionItem:nil];
}
///
- (void)xPMineHeadViewCliekNobleCenter {
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventvipEntranceMeClick];
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_noble_card_click];
[self pushViewControllerWithType:XPMineItemType_Noble_Center functionItem:nil];
}
@@ -418,6 +422,12 @@
[self.functionArray removeObject:obj];
}
}];
NSMutableArray *array = [NSMutableArray array];
for (XPMineFuntionItemModel *item in self.functionArray) {
[array addObject:item.centerName];
}
NSString *trackName = [array componentsJoinedByString:@","];
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_function_show eventAttributes:@{@"functionName" : trackName}];
[self.tableView reloadData];
}
@@ -426,6 +436,12 @@
[self.littleGameArray removeAllObjects];
[self.littleGameArray addObjectsFromArray:items];
[self.tableView reloadData];
NSMutableArray *array = [NSMutableArray array];
for (LittleGameInfoModel *item in self.littleGameArray) {
[array addObject:item.name];
}
NSString *trackName = [array componentsJoinedByString:@","];
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_quick_entry_show eventAttributes:@{@"gameName" : trackName}];
}
///banner
@@ -433,6 +449,12 @@
[self.bannerArray removeAllObjects];
[self.bannerArray addObjectsFromArray:items];
[self.tableView reloadData];
NSMutableArray *array = [NSMutableArray array];
for (HomeBannerInfoModel *item in self.bannerArray) {
[array addObject:item.bannerId];
}
NSString *trackName = [array componentsJoinedByString:@","];
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_banner_show eventAttributes:@{@"bannerId" : trackName}];
}
- (void)onGetUserInfoSuccess:(UserInfoModel *)userInfo {
@@ -461,6 +483,7 @@
make.top.mas_equalTo(kNavigationHeight + 80);
make.size.mas_equalTo(CGSizeMake(74, 88));
}];
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventUsercenterNugiftPopShow];
}
self.userRechargeView.endTime = userInfo.limitChargeEndTime;
} else {
@@ -486,9 +509,11 @@
///
- (void)quickMatchLittleGameRoomSuccess:(HomeLittleGameRoomModel *)roomInfo mgId:(NSString *)mgId {
if (roomInfo.isPick && roomInfo.uid.length > 0) {
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_quick_entrysuccess_click eventAttributes:@{@"roomUid" : roomInfo.uid}];
[XPRoomViewController openRoom:roomInfo.uid viewController:self];
} else if (roomInfo.needOpenSelfRoom) {
NSString* roomUid = [NSString stringWithFormat:@"%ld", (long)self.userInfo.uid];
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_quick_entrysuccess_click eventAttributes:@{@"roomUid" : roomUid}];
[Api getRoomInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
if (code == 200) {
RoomInfoModel * roomInfo = [RoomInfoModel modelWithJSON:data.data];
@@ -533,12 +558,14 @@
#pragma mark - XPMineHeadItemTableViewCellDelegate
- (void)xPMineHeadItemTableViewCell:(XPMineHeadItemTableViewCell *)cell didSelectItem:(XPMineFuntionItemModel *)item {
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_function_click eventAttributes:@{@"functionName" : item.centerName}];
[self pushViewControllerWithType:item.skipType functionItem:item];
}
#pragma mark - XPHomeBannerTableViewCellDelegate
///banner
- (void)xPHomeBannerTableViewCell:(XPHomeBannerTableViewCell *)view didClickBanner:(HomeBannerInfoModel *)info {
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_banner_click eventAttributes:@{@"bannerId" : info.bannerId}];
switch (info.skipType) {
case HomeBannerInfoSkipType_Room:
{
@@ -573,6 +600,7 @@
#pragma mark -
- (void)onNewUserRechargeTap:(UITapGestureRecognizer *)ges {
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventUsercenterNugiftPopClick];
XPNewUserRechargeViewController *vc = [[XPNewUserRechargeViewController alloc] initWithNavigation:self.navigationController];
[self.navigationController presentViewController:vc animated:YES completion:nil];
}

View File

@@ -29,6 +29,7 @@
#import "XPRoomMiniManager.h"
#import "Api+RoomPK.h"
#import "Api+Room.h"
#import "StatisticsServiceHelper.h"
///Model
#import "RoomInfoModel.h"
#import "MicroQueueModel.h"
@@ -389,6 +390,7 @@
XPNewUserRoomGiftView *view = [[XPNewUserRoomGiftView alloc] init];
view.giftInfo = giftInfo;
[TTPopup popupView:view style:TTPopupStyleAlert];
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventRoomNugivePopShow];
}
[defaults setBool:YES forKey:kHadShowNewUserGiftKey];
[defaults synchronize];

View File

@@ -14,6 +14,7 @@
#import "UIImage+Utils.h"
#import "TTPopup.h"
#import "XPMacro.h"
#import "StatisticsServiceHelper.h"
@interface XPNewUserRoomGiftView ()
@@ -88,6 +89,7 @@
#pragma mark - Event Response
- (void)closeButtonAction:(UIButton *)sender {
[TTPopup dismiss];
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventRoomNugivePopClick];
}
#pragma mark - Getters And Setters

View File

@@ -16,6 +16,7 @@
#import "UIButton+EnlargeTouchArea.h"
#import "XPSkillCardPlayerManager.h"
#import <AFNetworking.h>
#import "StatisticsServiceHelper.h"
///View
#import "XPAnchorCardSkillCollectionViewCell.h"
///Model
@@ -158,6 +159,7 @@
} else {
uid = [NSString stringWithFormat:@"%zd", self.cardInfo.uid];
}
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventPersonalshowTopCardRoomClick eventAttributes:@{@"roomUid" : uid}];
[self.delegate xPAnchorCardViewEnterRoom:uid];
}
}
@@ -246,6 +248,7 @@
sender.selected = YES;
[self pauseTimer];
[self.noteImaegView startAnimating];
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventPersonalshowTopCardVoiceClick];
[[XPSkillCardPlayerManager shareInstance] playerVoiceWithPath:fullPath completionBlock:^{
self.isPlaying = NO;
[self.noteImaegView stopAnimating];
@@ -263,6 +266,7 @@
self.isPlaying = YES;
sender.selected = YES;
[self.noteImaegView startAnimating];
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventPersonalshowTopCardVoiceClick];
[self pauseTimer];
[[XPSkillCardPlayerManager shareInstance] playerVoiceWithPath:fullPath completionBlock:^{
self.isPlaying = NO;

View File

@@ -14,6 +14,7 @@
#import "UIImage+Utils.h"
#import "XPFirstRechargeFlowLayout.h"
#import "Timestamp.h"
#import "StatisticsServiceHelper.h"
///Model
#import "NewUserRechargeModel.h"
///View
@@ -262,6 +263,7 @@
#pragma mark - Event Response
- (void)dismissFirstRechargeVC {
[self dismissViewControllerAnimated:YES completion:nil];
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventNugiftPopCloseClick];
}
- (void)rechargeButtonAction:(UIButton *)sender {

View File

@@ -26,6 +26,7 @@
#import "XCCurrentVCStackManager.h"
#import "Api+Home.h"
#import "XPConstant.h"
#import "StatisticsServiceHelper.h"
///Model
#import "AccountModel.h"
#import "RoomInfoModel.h"
@@ -139,6 +140,7 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
XPNewUserRechargeViewController *vc = [[XPNewUserRechargeViewController alloc] initWithNavigation:self.selectedViewController.navigationController];
vc.hadAnimate = YES;
[self.selectedViewController.navigationController presentViewController:vc animated:YES completion:nil];
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventNugiftPopShow];
}
if ([self hadLaunchApp] && [self canShowAnchorCard]) {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
@@ -267,6 +269,7 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
UISwipeGestureRecognizer *recognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleAnchorCardSwipeFrom:)];
[recognizer setDirection:(UISwipeGestureRecognizerDirectionUp)];
[self.anchorCardView addGestureRecognizer:recognizer];
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventPersonalshowTopCardShow];
}
}
@@ -496,6 +499,7 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
XPNewUserRechargeSucessView * firstRechargeView= [[XPNewUserRechargeSucessView alloc] init];
firstRechargeView.rechargeInfo = model;
[TTPopup popupView:firstRechargeView style:TTPopupStyleAlert];
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventnugift_pop_finish_click eventAttributes:@{@"buy_level" : [NSString stringWithFormat:@"%zd", model.chargeMoney]}];
}
} else if ([dic[@"first"] intValue] == CustomMessageType_Task_Complete && [dic[@"second"] intValue] == Custom_Message_Sub_TaskComplete) {///
if ([dic isKindOfClass:[NSDictionary class]]) {
@@ -551,6 +555,7 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
#pragma mark -
- (void)handleActivityTaskTip:(NSString *)msg url:(NSString *)url {
if (!self.taskTipView.superview && url.length) {
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventtask_toast_show];
[self.view addSubview:self.taskTipView];
self.taskTipView.desc = msg;
self.taskTipView.url = url;
@@ -566,6 +571,7 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
}
- (void)jumpToTask:(UITapGestureRecognizer *)ges {
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventtask_toast_click];
XPWebViewController * webVC =[[XPWebViewController alloc] init];
webVC.url = self.taskTipView.url;
[self.selectedViewController.navigationController pushViewController:webVC animated:YES];