Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/iphone
diff options
context:
space:
mode:
authorKirill Zhdanovich <kzhdanovich@gmail.com>2013-06-27 21:31:02 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:57:32 +0300
commitd4d2410322d3e99fec931a39e6fd036005698e0e (patch)
treed32d3daa30cf7775c1c5231b2105e6f548602e97 /iphone
parent391b773b604a628d3541cd86428951ff70c13781 (diff)
[iOS] new Statistics added
Diffstat (limited to 'iphone')
-rw-r--r--iphone/Maps/Bookmarks/PlacePageVC.mm43
-rw-r--r--iphone/Maps/Classes/MapsAppDelegate.mm10
-rw-r--r--iphone/Maps/Classes/SearchVC.mm8
3 files changed, 59 insertions, 2 deletions
diff --git a/iphone/Maps/Bookmarks/PlacePageVC.mm b/iphone/Maps/Bookmarks/PlacePageVC.mm
index ea7cc5869c..55cc17f99a 100644
--- a/iphone/Maps/Bookmarks/PlacePageVC.mm
+++ b/iphone/Maps/Bookmarks/PlacePageVC.mm
@@ -9,6 +9,7 @@
#include "Framework.h"
#include "../../search/result.hpp"
+#include "../../platform/settings.hpp"
@interface PinPickerView : UIView
@@ -98,6 +99,10 @@ typedef enum {Editing, Saved} Mode;
int m_selectedRow;
Mode m_mode;
size_t m_categoryIndex;
+
+ //statistics purpose
+ size_t m_categoryIndexStatistics;
+ size_t m_numberOfCategories;
}
@property (nonatomic, copy) UIView * viewWithPicker;
@@ -446,6 +451,8 @@ typedef enum {Editing, Saved} Mode;
{
[[Statistics instance] logEvent:@"Select Bookmark color"];
self.pinColor = g_colors[m_selectedRow];
+ if (!IsValid(self.pinEditedBookmark))
+ [[Statistics instance] logEvent:@"New Bookmark Color Changed"];
[self.tableView reloadData];
}
[self pickerCancelClicked];
@@ -591,19 +598,51 @@ typedef enum {Editing, Saved} Mode;
{
Framework & f = GetFramework();
if (_pinEditedBookmark == MakeEmptyBookmarkAndCategory())
+ {
+ if ([self.pinNotes length] != 0)
+ [[Statistics instance] logEvent:@"New Bookmark Description Field Occupancy" withParameters:@{@"Occupancy" : @"Filled"}];
+ else
+ [[Statistics instance] logEvent:@"New Bookmark Description Field Occupancy" withParameters:@{@"Occupancy" : @"Empty"}];
+
+ if (m_categoryIndexStatistics != m_categoryIndex)
+ [[Statistics instance] logEvent:@"New Bookmark Category" withParameters:@{@"Changed" : @"YES"}];
+ else
+ [[Statistics instance] logEvent:@"New Bookmark Category" withParameters:@{@"Changed" : @"NO"}];
+
+ if (m_numberOfCategories != GetFramework().GetBmCategoriesCount())
+ [[Statistics instance] logEvent:@"New Bookmark Category Set Was Created" withParameters:@{@"Created" : @"YES"}];
+ else
+ [[Statistics instance] logEvent:@"New Bookmark Category Set Was Created" withParameters:@{@"Created" : @"NO"}];
+
+ int value = 0;
+ if (Settings::Get("NumberOfBookmarksPerSession", value))
+ Settings::Set("NumberOfBookmarksPerSession", ++value);
[self addBookmarkToCategory:m_categoryIndex];
+ }
else
{
BookmarkCategory * cat = f.GetBmCategory(_pinEditedBookmark.first);
+ Bookmark * bm = cat->GetBookmark(_pinEditedBookmark.second);
+
+ if ([self.pinColor isEqualToString:[NSString stringWithUTF8String:bm->GetType().c_str()]])
+ [[Statistics instance] logEvent:@"Bookmark Color" withParameters:@{@"Changed" : @"NO"}];
+ else
+ [[Statistics instance] logEvent:@"Bookmark Color" withParameters:@{@"Changed" : @"YES"}];
+
+ if ([self.pinNotes isEqualToString:[NSString stringWithUTF8String:bm->GetDescription().c_str()]])
+ [[Statistics instance] logEvent:@"Bookmark Description Field" withParameters:@{@"Changed" : @"NO"}];
+ else
+ [[Statistics instance] logEvent:@"Bookmark Description Field" withParameters:@{@"Changed" : @"YES"}];
if (_pinEditedBookmark.first != m_categoryIndex)
{
+ [[Statistics instance] logEvent:@"Bookmark Category" withParameters:@{@"Changed" : @"YES"}];
cat->DeleteBookmark(_pinEditedBookmark.second);
cat->SaveToKMLFile();
[self addBookmarkToCategory:m_categoryIndex];
}
else
{
- Bookmark * bm = cat->GetBookmark(_pinEditedBookmark.second);
+ [[Statistics instance] logEvent:@"Bookmark Category" withParameters:@{@"Changed" : @"NO"}];
bm->SetName([self.pinTitle UTF8String]);
bm->SetType([self.pinColor UTF8String]);
bm->SetDescription([self.pinNotes UTF8String]);
@@ -632,6 +671,8 @@ typedef enum {Editing, Saved} Mode;
m_categoryIndex = bmAndCat.first == - 1 ? GetFramework().LastEditedCategory():bmAndCat.first;
self.pinGlobalPosition = point;
self.pinType = type;
+ m_categoryIndexStatistics = m_categoryIndex;
+ m_numberOfCategories = GetFramework().GetBmCategoriesCount();
}
-(UITextView *)createTextFieldForCell:(UIFont *)font color:(UIColor *)color
diff --git a/iphone/Maps/Classes/MapsAppDelegate.mm b/iphone/Maps/Classes/MapsAppDelegate.mm
index 93d39dfbf1..e10f33dceb 100644
--- a/iphone/Maps/Classes/MapsAppDelegate.mm
+++ b/iphone/Maps/Classes/MapsAppDelegate.mm
@@ -166,6 +166,14 @@ void InitLocalizedStrings()
m_didOpenedWithUrl = NO;
+ if (GetPlatform().IsPro())
+ {
+ int val = 0;
+ if (Settings::Get("NumberOfBookmarksPerSession", val))
+ [[Statistics instance] logEvent:@"Bookmarks Per Session" withParameters:@{@"Number of bookmarks" : [NSNumber numberWithInt:val]}];
+ Settings::Set("NumberOfBookmarksPerSession", 0);
+ }
+
return [launchOptions objectForKey:UIApplicationLaunchOptionsURLKey] != nil;
}
@@ -196,7 +204,7 @@ void InitLocalizedStrings()
url_scheme::ApiPoint apiPoint;
if (GetFramework().SetViewportByURL([[url.absoluteString stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding] UTF8String], apiPoint));
{
- [[Statistics instance] logEvent:@"ge0(zero) Import"];
+ [[Statistics instance] logApiUsage:sourceApplication];
[self showMap];
[m_mapViewController prepareForApi];
return YES;
diff --git a/iphone/Maps/Classes/SearchVC.mm b/iphone/Maps/Classes/SearchVC.mm
index e88b682481..2dd07bf608 100644
--- a/iphone/Maps/Classes/SearchVC.mm
+++ b/iphone/Maps/Classes/SearchVC.mm
@@ -502,6 +502,7 @@ static void OnSearchResultCallback(search::Results const & res)
// Suggestion cell was clicked
if (m_suggestionsCount)
{
+ [[Statistics instance] logEvent:@"Category Selection" withParameters:@{@"Category" : [categoriesNames objectAtIndex:realRowIndex]}];
[self setSearchBoxText:[NSLocalizedString([categoriesNames objectAtIndex:realRowIndex], Search Suggestion) stringByAppendingString:@" "]];
[m_table scrollRectToVisible:CGRectMake(0, 0, 1, 1) animated:YES];
return;
@@ -520,6 +521,13 @@ static void OnSearchResultCallback(search::Results const & res)
search::AddressInfo info;
info.MakeFrom(res);
+ if (scopeSection == 0)
+ [[Statistics instance] logEvent:@"Search Filter" withParameters:@{@"Filter Name" : @"Near Me"}];
+ else if (scopeSection == 1)
+ [[Statistics instance] logEvent:@"Search Filter" withParameters:@{@"Filter Name" : @"On the Screen"}];
+ else
+ [[Statistics instance] logEvent:@"Search Filter" withParameters:@{@"Filter Name" : @"Everywhere"}];
+
[[MapsAppDelegate theApp].m_mapViewController showSearchResultAsBookmarkAtMercatorPoint:res.GetFeatureCenter() withInfo:info];
[self onCloseButton:nil];