diff options
author | Aleksandr Zatsepin <alexzatsepin@users.noreply.github.com> | 2017-04-05 11:00:57 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-05 11:00:57 +0300 |
commit | ad102d07e0086d8867b6b6f872b8b6ebd25e17a4 (patch) | |
tree | 17205a9eab7c8a64f71d2ec8f0fcbb1eea810e00 | |
parent | 066e20c2a504464554f0d094ee923c28b9b35f37 (diff) | |
parent | 6159724e6f7aef87e2aec43f9c85ec879cbf701a (diff) |
Merge pull request #5759 from goblinr/MAPSME-187-ext-statistic-for-booking-search-buttonbeta-735
[android] Added statistic event for search booking button click.
-rw-r--r-- | android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java | 4 | ||||
-rw-r--r-- | android/src/com/mapswithme/util/statistics/Statistics.java | 14 |
2 files changed, 16 insertions, 2 deletions
diff --git a/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java b/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java index 30db864e83..187a663902 100644 --- a/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java +++ b/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java @@ -46,7 +46,6 @@ import com.mapswithme.maps.R; import com.mapswithme.maps.ads.CompoundNativeAdLoader; import com.mapswithme.maps.ads.DefaultAdTracker; import com.mapswithme.maps.ads.Factory; -import com.mapswithme.maps.ads.NativeAdLoader; import com.mapswithme.maps.api.ParsedMwmRequest; import com.mapswithme.maps.bookmarks.data.Bookmark; import com.mapswithme.maps.bookmarks.data.BookmarkManager; @@ -508,7 +507,10 @@ public class PlacePageView extends RelativeLayout case BOOKING_SEARCH: if (mMapObject != null) + { + Statistics.INSTANCE.trackBookingSearchEvent(mMapObject); followUrl(mMapObject.getBookingSearchUrl()); + } break; case CALL: diff --git a/android/src/com/mapswithme/util/statistics/Statistics.java b/android/src/com/mapswithme/util/statistics/Statistics.java index 9c9376bb38..dda2f57931 100644 --- a/android/src/com/mapswithme/util/statistics/Statistics.java +++ b/android/src/com/mapswithme/util/statistics/Statistics.java @@ -20,7 +20,6 @@ import com.mapswithme.maps.PrivateVariables; import com.mapswithme.maps.ads.MwmNativeAd; import com.mapswithme.maps.ads.NativeAdError; import com.mapswithme.maps.api.ParsedMwmRequest; -import com.mapswithme.maps.ads.Banner; import com.mapswithme.maps.bookmarks.data.MapObject; import com.mapswithme.maps.downloader.MapManager; import com.mapswithme.maps.editor.Editor; @@ -51,6 +50,7 @@ import static com.mapswithme.util.statistics.Statistics.EventParam.RESTAURANT_LA import static com.mapswithme.util.statistics.Statistics.EventParam.RESTAURANT_LON; import static com.mapswithme.util.statistics.Statistics.ParamValue.BOOKING_COM; import static com.mapswithme.util.statistics.Statistics.ParamValue.OPENTABLE; +import static com.mapswithme.util.statistics.Statistics.ParamValue.SEARCH_BOOKING_COM; public enum Statistics { @@ -264,6 +264,7 @@ public enum Statistics public static class ParamValue { public static final String BOOKING_COM = "Booking.Com"; + public static final String SEARCH_BOOKING_COM = "Search.Booking.Com"; public static final String OPENTABLE = "OpenTable"; } @@ -542,6 +543,17 @@ public enum Statistics trackEvent(eventName, builder.get()); } + public void trackBookingSearchEvent(@NonNull MapObject mapObject) + { + trackEvent(PP_SPONSORED_BOOK, LocationHelper.INSTANCE.getLastKnownLocation(), + Statistics.params() + .add(PROVIDER, SEARCH_BOOKING_COM) + .add(HOTEL, "") + .add(HOTEL_LAT, mapObject.getLat()) + .add(HOTEL_LON, mapObject.getLon()) + .get()); + } + public static ParameterBuilder params() { return new ParameterBuilder(); |