diff --git a/android/jni/com/mapswithme/maps/UserMarkHelper.cpp b/android/jni/com/mapswithme/maps/UserMarkHelper.cpp index 1753cf58a9..d1b2fe129b 100644 --- a/android/jni/com/mapswithme/maps/UserMarkHelper.cpp +++ b/android/jni/com/mapswithme/maps/UserMarkHelper.cpp @@ -46,7 +46,7 @@ jobject CreateMapObject(JNIEnv * env, string const & mwmName, int64_t mwmVersion // public MapObject(@NonNull String mwmName, long mwmVersion, int featureIndex, // @MapObjectType int mapObjectType, String title, @Nullable String secondaryTitle, // String subtitle, String address, double lat, double lon, String apiId, - // @Nullable Banner[] banners, @TaxiTapy int[] reachableByTaxiTypes, + // @Nullable Banner[] banners, @TaxiType int[] reachableByTaxiTypes, // @Nullable String bookingSearchUrl, @Nullable LocalAdInfo localAdInfo, // @Nullable RoutePointInfo routePointInfo) static jmethodID const ctorId = diff --git a/android/src/com/mapswithme/maps/routing/RoutingBottomMenuController.java b/android/src/com/mapswithme/maps/routing/RoutingBottomMenuController.java index cfabd946a0..84cbb9e85e 100644 --- a/android/src/com/mapswithme/maps/routing/RoutingBottomMenuController.java +++ b/android/src/com/mapswithme/maps/routing/RoutingBottomMenuController.java @@ -349,7 +349,7 @@ final class RoutingBottomMenuController implements View.OnClickListener MapObject from = RoutingController.get().getStartPoint(); MapObject to = RoutingController.get().getEndPoint(); Location location = LocationHelper.INSTANCE.getLastKnownLocation(); - Statistics.INSTANCE.trackTaxi(from, to, location, type, isTaxiAppInstalled); + Statistics.INSTANCE.trackTaxiInRoutePlanning(from, to, location, type, isTaxiAppInstalled); } @Override diff --git a/android/src/com/mapswithme/maps/routing/RoutingController.java b/android/src/com/mapswithme/maps/routing/RoutingController.java index 884bdb069a..38924418e2 100644 --- a/android/src/com/mapswithme/maps/routing/RoutingController.java +++ b/android/src/com/mapswithme/maps/routing/RoutingController.java @@ -920,6 +920,8 @@ public class RoutingController implements TaxiManager.TaxiListener { mContainer.onTaxiInfoReceived(provider); completeTaxiRequest(); + Statistics.INSTANCE.trackTaxiEvent(Statistics.EventName.ROUTING_TAXI_ROUTE_BUILT, + provider.getType()); } } @@ -932,6 +934,7 @@ public class RoutingController implements TaxiManager.TaxiListener { mContainer.onTaxiError(error.getCode()); completeTaxiRequest(); + Statistics.INSTANCE.trackTaxiError(error); } } } diff --git a/android/src/com/mapswithme/maps/taxi/TaxiInfoError.java b/android/src/com/mapswithme/maps/taxi/TaxiInfoError.java index 7a29fe2c82..0e941935d7 100644 --- a/android/src/com/mapswithme/maps/taxi/TaxiInfoError.java +++ b/android/src/com/mapswithme/maps/taxi/TaxiInfoError.java @@ -21,6 +21,12 @@ public class TaxiInfoError return mCode; } + @TaxiManager.TaxiType + public int getType() + { + return mType; + } + @Override public String toString() { diff --git a/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java b/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java index f0b9093e63..1fbbb83d13 100644 --- a/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java +++ b/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java @@ -1319,6 +1319,7 @@ public class PlacePageView extends RelativeLayout int type = types.get(0); UiUtils.showTaxiIcon((ImageView) mTaxi.findViewById(R.id.iv__place_page_taxi), type); UiUtils.showTaxiTitle((TextView) mTaxi.findViewById(R.id.tv__place_page_taxi), type); + Statistics.INSTANCE.trackTaxiEvent(Statistics.EventName.ROUTING_TAXI_SHOW_IN_PP, type); } private void hideHotelViews() @@ -1726,6 +1727,16 @@ public class PlacePageView extends RelativeLayout Framework.ROUTER_TYPE_TAXI); hide(); Framework.nativeDeactivatePopup(); + if (mMapObject != null) + { + List types = mMapObject.getReachableByTaxiTypes(); + if (types != null && !types.isEmpty()) + { + @TaxiManager.TaxiType + int type = types.get(0); + Statistics.INSTANCE.trackTaxiEvent(Statistics.EventName.ROUTING_TAXI_CLICK_IN_PP, type); + } + } break; case R.id.btn__viator_more: if (mSponsored != null) diff --git a/android/src/com/mapswithme/util/statistics/Statistics.java b/android/src/com/mapswithme/util/statistics/Statistics.java index d6b2249904..c298910e4d 100644 --- a/android/src/com/mapswithme/util/statistics/Statistics.java +++ b/android/src/com/mapswithme/util/statistics/Statistics.java @@ -26,6 +26,7 @@ import com.mapswithme.maps.downloader.MapManager; import com.mapswithme.maps.editor.Editor; import com.mapswithme.maps.editor.OsmOAuth; import com.mapswithme.maps.location.LocationHelper; +import com.mapswithme.maps.taxi.TaxiInfoError; import com.mapswithme.maps.taxi.TaxiManager; import com.mapswithme.maps.widget.placepage.Sponsored; import com.mapswithme.util.BatteryState; @@ -192,6 +193,9 @@ public enum Statistics public static final String ROUTING_TTS_SWITCH = "Routing. Switch tts"; public static final String ROUTING_TAXI_ORDER = "Routing_Taxi_order"; public static final String ROUTING_TAXI_INSTALL = "Routing_Taxi_install"; + public static final String ROUTING_TAXI_SHOW_IN_PP = "Placepage_Taxi_show"; + public static final String ROUTING_TAXI_CLICK_IN_PP = "Placepage_Taxi_click"; + public static final String ROUTING_TAXI_ROUTE_BUILT = "Routing_Build_Taxi"; // editor public static final String EDITOR_START_CREATE = "Editor_Add_start"; @@ -520,8 +524,8 @@ public enum Statistics trackEvent(EventName.EDITOR_AUTH_REQUEST, Statistics.params().add(Statistics.EventParam.TYPE, type.name)); } - public void trackTaxi(@Nullable MapObject from, @Nullable MapObject to, - @Nullable Location location, @TaxiManager.TaxiType int type, boolean isAppInstalled) + public void trackTaxiInRoutePlanning(@Nullable MapObject from, @Nullable MapObject to, + @Nullable Location location, @TaxiManager.TaxiType int type, boolean isAppInstalled) { Statistics.ParameterBuilder params = Statistics.params(); params.add(Statistics.EventParam.PROVIDER, type == TaxiManager.PROVIDER_YANDEX ? "Yandex" : "Uber"); @@ -537,6 +541,23 @@ public enum Statistics trackEvent(event, location, params.get()); } + public void trackTaxiEvent(@NonNull String eventName, @TaxiManager.TaxiType int type) + { + Statistics.ParameterBuilder params = Statistics.params(); + params.add(Statistics.EventParam.PROVIDER, + type == TaxiManager.PROVIDER_YANDEX ? "Yandex" : "Uber"); + trackEvent(eventName, params); + } + + public void trackTaxiError(@NonNull TaxiInfoError error) + { + Statistics.ParameterBuilder params = Statistics.params(); + params.add(Statistics.EventParam.PROVIDER, + error.getType() == TaxiManager.PROVIDER_YANDEX ? "Yandex" : "Uber"); + params.add(ERROR_CODE, error.getCode().name()); + trackEvent(EventName.ROUTING_TAXI_ROUTE_BUILT, params); + } + public void trackRestaurantEvent(@NonNull String eventName, @NonNull Sponsored restaurant, @NonNull MapObject mapObject) {