[MAPSME-5286] [iOS] 1link stats for Cian search category.

This commit is contained in:
Ilya Grechuhin 2017-08-14 11:36:45 +03:00 committed by burivuh
parent 663c73b941
commit 35acf794a5
2 changed files with 19 additions and 0 deletions

View file

@ -240,6 +240,8 @@ static NSString * const kStatScenario = @"scenario";
static NSString * const kStatScreen = @"Screen";
static NSString * const kStatSearch = @"search";
static NSString * const kStatSearchEnteredState = @"Search entered state";
static NSString * const kStatSearchSponsoredSelect = @"Search_SponsoredCategory_selected";
static NSString * const kStatSearchSponsoredShow = @"Search_SponsoredCategory_shown";
static NSString * const kStatSelectMap = @"Select map";
static NSString * const kStatSelectResult = @"Select result";
static NSString * const kStatSelectTab = @"Select tab";

View file

@ -1,4 +1,5 @@
#import "MWMSearchCategoriesManager.h"
#import <MyTrackerSDK/MRMyTracker.h>
#import "AppInfo.h"
#import "MWMSearchCategoryCell.h"
#import "Statistics.h"
@ -56,6 +57,18 @@ extern NSString * const kCianCategory = @"cian";
#pragma mark - UITableViewDelegate
- (void)tableView:(UITableView *)tableView
willDisplayCell:(UITableViewCell *)cell
forRowAtIndexPath:(NSIndexPath *)indexPath
{
NSString * string = @(m_categories[indexPath.row].c_str());
if ([string isEqualToString:kCianCategory])
{
[MRMyTracker trackEventWithName:@"Search_SponsoredCategory_shown_Cian"];
[Statistics logEvent:kStatSearchSponsoredShow withParameters:@{kStatProvider : kStatCian}];
}
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSString * string = @(m_categories[indexPath.row].c_str());
@ -66,7 +79,11 @@ extern NSString * const kCianCategory = @"cian";
forInputLocale:[[AppInfo sharedInfo] languageId]];
[delegate dismissKeyboard];
if ([string isEqualToString:kCianCategory])
{
delegate.state = MWMSearchManagerStateMapSearch;
[MRMyTracker trackEventWithName:@"Search_SponsoredCategory_selected_Cian"];
[Statistics logEvent:kStatSearchSponsoredSelect withParameters:@{kStatProvider : kStatCian}];
}
}
@end