添加埋点

This commit is contained in:
2026-01-06 19:25:34 +08:00
parent 1096f24c57
commit c3909d63da
30 changed files with 784 additions and 39 deletions

View File

@@ -120,6 +120,13 @@ static NSString * const kResultCellId = @"KBSkinCardCell";
KBSearchThemeModel *model = self.resultItems[indexPath.item];
NSString *themeId = [model.themeId stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
if (themeId.length == 0) { return; }
NSDictionary *extra = @{@"theme_id": themeId,
@"index": @(indexPath.item)};
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_search_result_theme"
pageId:@"search_result"
elementId:@"result_theme_card"
extra:extra
completion:nil];
KBSkinDetailVC *vc = [[KBSkinDetailVC alloc] init];
vc.themeId = themeId;
[self.navigationController pushViewController:vc animated:YES];

View File

@@ -244,6 +244,11 @@ typedef NS_ENUM(NSInteger, KBSearchSection) {
///
- (void)clearHistory {
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_search_clear_history"
pageId:@"search"
elementId:@"clear_history"
extra:nil
completion:nil];
[self.historyWords removeAllObjects];
self.historyExpanded = NO;
[self saveHistoryWordsToLocal:self.historyWords];
@@ -369,10 +374,22 @@ typedef NS_ENUM(NSInteger, KBSearchSection) {
NSArray *list = [self currentDisplayHistory];
NSString *kw = list[indexPath.item];
if ([kw isEqualToString:kMoreToken]) {
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_search_history_more"
pageId:@"search"
elementId:@"history_more"
extra:nil
completion:nil];
//
self.historyExpanded = YES;
[self.collectionView reloadData];
} else {
NSDictionary *extra = @{@"index": @(indexPath.item),
@"keyword_len": @(kw.length)};
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_search_history_item"
pageId:@"search"
elementId:@"history_item"
extra:extra
completion:nil];
[self.searchBarView updateKeyword:kw];
[self performSearch:kw];
[self openResultForKeyword:kw];
@@ -381,6 +398,16 @@ typedef NS_ENUM(NSInteger, KBSearchSection) {
}
if (indexPath.section == KBSearchSectionRecommend) {
KBShopThemeModel *model = self.recommendedThemes[indexPath.item];
NSMutableDictionary *extra = [NSMutableDictionary dictionary];
extra[@"index"] = @(indexPath.item);
if ([model.themeId isKindOfClass:NSString.class] && model.themeId.length > 0) {
extra[@"theme_id"] = model.themeId;
}
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_search_recommend_theme"
pageId:@"search"
elementId:@"recommend_theme_card"
extra:extra.copy
completion:nil];
[self openDetailForThemeId:model.themeId ?: @""];
}
}
@@ -394,6 +421,12 @@ typedef NS_ENUM(NSInteger, KBSearchSection) {
// _searchBarView.placeholder = @"Themes";
KBWeakSelf
_searchBarView.onSearch = ^(NSString * _Nonnull keyword) {
NSDictionary *extra = @{@"keyword_len": @(keyword.length)};
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_search_submit"
pageId:@"search"
elementId:@"search_submit"
extra:extra
completion:nil];
// +
[weakSelf performSearch:keyword];
[weakSelf openResultForKeyword:keyword];