[iOS] fix routing stats

This commit is contained in:
Aleksey Belouosv 2018-07-16 17:52:58 +03:00 committed by Vlad Mihaylenko
parent 7e20a1cad4
commit bb8018b4bd
3 changed files with 19 additions and 3 deletions

View file

@ -171,7 +171,6 @@ final class RouteManagerViewController: MWMViewController, UITableViewDataSource
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
Statistics.logEvent(kStatRouteManagerClose)
}
override func viewWillLayoutSubviews() {
@ -194,11 +193,13 @@ final class RouteManagerViewController: MWMViewController, UITableViewDataSource
@IBAction func onCancel() {
viewModel.cancelTransaction()
Statistics.logEvent(kStatRouteManagerClose, withParameters: [kStatType : kStatCancel])
dismiss(animated: true, completion: nil)
}
@IBAction func onPlan() {
viewModel.finishTransaction()
Statistics.logEvent(kStatRouteManagerClose, withParameters: [kStatType : kStatDone])
dismiss(animated: true, completion: nil)
}

View file

@ -55,6 +55,7 @@ static NSString * const kStatButton = @"Button";
static NSString * const kStatCallPhoneNumber = @"Call phone number";
static NSString * const kStatCampSite = @"campSite";
static NSString * const kStatCancel = @"cancel";
static NSString * const kStatDone = @"done";
static NSString * const kStatCategories = @"Categories";
static NSString * const kStatCategory = @"category";
static NSString * const kStatChalet = @"chalet";
@ -298,6 +299,9 @@ static NSString * const kStatRoutingSearchClicked = @"Routing_Search_click";
static NSString * const kStatRoutingTaxiInstall = @"Routing_Taxi_install";
static NSString * const kStatRoutingTaxiOrder = @"Routing_Taxi_order";
static NSString * const kStatRoutingTooltipClicked = @"Routing_PlanTooltip_click";
static NSString * const kStatRoutingRouteStart = @"Routing_Route_start";
static NSString * const kStatRoutingRouteFinish = @"Routing_Route_finish";
static NSString * const kStatRoutingInterrupted = @"interrupted";
static NSString * const kStatSave = @"Save";
static NSString * const kStatScenario = @"scenario";
static NSString * const kStatScreen = @"Screen";

View file

@ -158,6 +158,11 @@ void logPointEvent(MWMRoutePoint * point, NSString * eventType)
+ (void)stopRouting
{
auto type = GetFramework().GetRoutingManager().GetRouter();
[Statistics logEvent:kStatRoutingRouteFinish withParameters:@{
kStatMode : @(routing::ToString(type).c_str()),
kStatRoutingInterrupted : @([self isRouteFinished])
}];
[self stop:YES];
}
@ -436,7 +441,14 @@ void logPointEvent(MWMRoutePoint * point, NSString * eventType)
else
[Statistics logEvent:kStatEventName(kStatPointToPoint, kStatGo)
withParameters:@{kStatValue : kStatPointToPoint}];
auto type = GetFramework().GetRoutingManager().GetRouter();
[Statistics logEvent:kStatRoutingRouteStart
withParameters:@{
kStatMode : @(routing::ToString(type).c_str()),
kStatTraffic : @(GetFramework().GetTrafficManager().IsEnabled())
}];
if (p1.isMyPosition && [MWMLocationManager lastLocation])
{
rm.FollowRoute();
@ -486,7 +498,6 @@ void logPointEvent(MWMRoutePoint * point, NSString * eventType)
+ (void)stop:(BOOL)removeRoutePoints
{
[Statistics logEvent:kStatEventName(kStatPointToPoint, kStatClose)];
[self doStop:removeRoutePoints];
// Don't save taxi routing type as default.
if ([MWMRouter isTaxi])