[android] Added statistics for deeplinks
This commit is contained in:
parent
b97dbf3572
commit
59cfc5c3d1
7 changed files with 252 additions and 44 deletions
|
@ -6,10 +6,6 @@ import android.graphics.Color;
|
|||
import android.location.Location;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import androidx.annotation.CallSuper;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.StringRes;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
|
@ -18,6 +14,10 @@ import android.widget.ProgressBar;
|
|||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.CallSuper;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.StringRes;
|
||||
import com.mapswithme.maps.base.BaseMwmFragmentActivity;
|
||||
import com.mapswithme.maps.downloader.CountryItem;
|
||||
import com.mapswithme.maps.downloader.MapManager;
|
||||
|
|
|
@ -64,6 +64,7 @@ import com.mapswithme.maps.editor.ReportFragment;
|
|||
import com.mapswithme.maps.gallery.Items;
|
||||
import com.mapswithme.maps.intent.Factory;
|
||||
import com.mapswithme.maps.intent.MapTask;
|
||||
import com.mapswithme.maps.intent.RegularMapTask;
|
||||
import com.mapswithme.maps.location.CompassData;
|
||||
import com.mapswithme.maps.location.LocationHelper;
|
||||
import com.mapswithme.maps.maplayer.MapLayerCompositeController;
|
||||
|
@ -1034,7 +1035,17 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
|||
if (category == null)
|
||||
throw new IllegalArgumentException("Category not found in bundle");
|
||||
|
||||
MapTask mapTask = target -> showBookmarkCategory(category);
|
||||
MapTask mapTask = new RegularMapTask()
|
||||
{
|
||||
private static final long serialVersionUID = -7417385158050827655L;
|
||||
|
||||
@Override
|
||||
public boolean run(@NonNull MwmActivity target)
|
||||
{
|
||||
target.showBookmarkCategory(category);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
addTask(mapTask);
|
||||
closePlacePage();
|
||||
}
|
||||
|
@ -1122,22 +1133,34 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
|||
@Override
|
||||
public void onRouteToDiscoveredObject(@NonNull final MapObject object)
|
||||
{
|
||||
addTask((MapTask) target ->
|
||||
addTask(new RegularMapTask()
|
||||
{
|
||||
RoutingController.get().attach(this);
|
||||
RoutingController.get().setRouterType(Framework.ROUTER_TYPE_PEDESTRIAN);
|
||||
RoutingController.get().prepare(true, object);
|
||||
return false;
|
||||
private static final long serialVersionUID = -219799471997583494L;
|
||||
|
||||
@Override
|
||||
public boolean run(@NonNull MwmActivity target)
|
||||
{
|
||||
RoutingController.get().attach(target);
|
||||
RoutingController.get().setRouterType(Framework.ROUTER_TYPE_PEDESTRIAN);
|
||||
RoutingController.get().prepare(true, object);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onShowDiscoveredObject(@NonNull final MapObject object)
|
||||
{
|
||||
addTask((MapTask) target ->
|
||||
addTask(new RegularMapTask()
|
||||
{
|
||||
Framework.nativeShowFeatureByLatLon(object.getLat(), object.getLon());
|
||||
return false;
|
||||
private static final long serialVersionUID = 7499190617762270631L;
|
||||
|
||||
@Override
|
||||
public boolean run(@NonNull MwmActivity target)
|
||||
{
|
||||
Framework.nativeShowFeatureByLatLon(object.getLat(), object.getLon());
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -1944,8 +1967,10 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
|||
|
||||
private void adjustCompassAndTraffic(final int offsetY)
|
||||
{
|
||||
addTask(new MapTask()
|
||||
addTask(new RegularMapTask()
|
||||
{
|
||||
private static final long serialVersionUID = 9177064181621376624L;
|
||||
|
||||
@Override
|
||||
public boolean run(@NonNull MwmActivity target)
|
||||
{
|
||||
|
|
|
@ -10,7 +10,6 @@ import androidx.annotation.NonNull;
|
|||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.mapswithme.maps.DownloadResourcesLegacyActivity;
|
||||
import com.mapswithme.maps.Framework;
|
||||
import com.mapswithme.maps.MapFragment;
|
||||
|
@ -59,6 +58,7 @@ import java.util.Locale;
|
|||
public class Factory
|
||||
{
|
||||
public static final String EXTRA_IS_FIRST_LAUNCH = "extra_is_first_launch";
|
||||
|
||||
@NonNull
|
||||
public static IntentProcessor createBuildRouteProcessor()
|
||||
{
|
||||
|
@ -200,7 +200,7 @@ public class Factory
|
|||
@Override
|
||||
MapTask createMapTask(@NonNull String uri)
|
||||
{
|
||||
return BackUrlMapTaskWrapper.wrap(new OpenUrlTask(uri), uri);
|
||||
return BackUrlMapTaskWrapper.wrap(new OpenUrlTask(uri, Statistics.ParamValue.UNKNOWN), uri);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -211,6 +211,13 @@ public class Factory
|
|||
{
|
||||
return (intent.getData() != null && "geo".equals(intent.getScheme()));
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
MapTask createMapTask(@NonNull String uri)
|
||||
{
|
||||
return StatisticMapTaskWrapper.wrap(new OpenUrlTask(uri, "geo"));
|
||||
}
|
||||
}
|
||||
|
||||
private static class Ge0IntentProcessor extends BaseOpenUrlProcessor
|
||||
|
@ -220,6 +227,13 @@ public class Factory
|
|||
{
|
||||
return (intent.getData() != null && "ge0".equals(intent.getScheme()));
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
MapTask createMapTask(@NonNull String uri)
|
||||
{
|
||||
return StatisticMapTaskWrapper.wrap(new OpenUrlTask(uri, "ge0"));
|
||||
}
|
||||
}
|
||||
|
||||
private static class MapsmeProcessor extends BaseOpenUrlProcessor
|
||||
|
@ -229,6 +243,13 @@ public class Factory
|
|||
{
|
||||
return "mapsme".equals(intent.getScheme());
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
MapTask createMapTask(@NonNull String uri)
|
||||
{
|
||||
return StatisticMapTaskWrapper.wrap(new OpenUrlTask(uri, "mapsme"));
|
||||
}
|
||||
}
|
||||
|
||||
private static class HttpGe0IntentProcessor implements IntentProcessor
|
||||
|
@ -253,7 +274,7 @@ public class Factory
|
|||
final Uri data = intent.getData();
|
||||
final String ge0Url = "ge0:/" + data.getPath();
|
||||
org.alohalytics.Statistics.logEvent("HttpGe0IntentProcessor::process", ge0Url);
|
||||
return new OpenUrlTask(ge0Url);
|
||||
return StatisticMapTaskWrapper.wrap(new OpenUrlTask(ge0Url, "http_ge0_me"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -283,7 +304,7 @@ public class Factory
|
|||
Statistics.INSTANCE.trackApiCall(request);
|
||||
|
||||
if (!ParsedMwmRequest.isPickPointMode())
|
||||
return new OpenUrlTask(apiUrl);
|
||||
return StatisticMapTaskWrapper.wrap(new OpenUrlTask(apiUrl, "action_api_request"));
|
||||
}
|
||||
|
||||
throw new AssertionError("Url must be provided!");
|
||||
|
@ -298,6 +319,13 @@ public class Factory
|
|||
final Uri data = intent.getData();
|
||||
return (data != null && "maps.google.com".equals(data.getHost()));
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
MapTask createMapTask(@NonNull String uri)
|
||||
{
|
||||
return StatisticMapTaskWrapper.wrap(new OpenUrlTask(uri, "maps_google_com"));
|
||||
}
|
||||
}
|
||||
|
||||
private static class OldLeadUrlIntentProcessor extends BaseOpenUrlProcessor
|
||||
|
@ -317,6 +345,13 @@ public class Factory
|
|||
|
||||
return (scheme.equals("mapsme") || scheme.equals("mapswithme")) && "lead".equals(host);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
MapTask createMapTask(@NonNull String uri)
|
||||
{
|
||||
return StatisticMapTaskWrapper.wrap(new OpenUrlTask(uri, "old_lead"));
|
||||
}
|
||||
}
|
||||
|
||||
private static class DlinkBookmarkCatalogueIntentProcessor extends DlinkIntentProcessor
|
||||
|
@ -340,7 +375,7 @@ public class Factory
|
|||
@Override
|
||||
MapTask createTargetTask(@NonNull String url)
|
||||
{
|
||||
return new ImportBookmarkCatalogueTask(url);
|
||||
return StatisticMapTaskWrapper.wrap(new ImportBookmarkCatalogueTask(url));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -365,7 +400,7 @@ public class Factory
|
|||
@Override
|
||||
MapTask createTargetTask(@NonNull String url)
|
||||
{
|
||||
return new GuidesPageToOpenTask(url);
|
||||
return StatisticMapTaskWrapper.wrap(new GuidesPageToOpenTask(url));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -391,7 +426,7 @@ public class Factory
|
|||
@Override
|
||||
MapTask createTargetTask(@NonNull String url)
|
||||
{
|
||||
return new BookmarksSubscriptionTask(url);
|
||||
return StatisticMapTaskWrapper.wrap(new BookmarksSubscriptionTask(url));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -406,7 +441,7 @@ public class Factory
|
|||
.authority(DlinkIntentProcessor.HOST)
|
||||
.path(DlinkBookmarkCatalogueIntentProcessor.CATALOGUE)
|
||||
.build().toString();
|
||||
return new ImportBookmarkCatalogueTask(url);
|
||||
return StatisticMapTaskWrapper.wrap(new ImportBookmarkCatalogueTask(url));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -428,12 +463,6 @@ public class Factory
|
|||
{
|
||||
private static final String SCHEME_CORE = "mapsme";
|
||||
|
||||
@Override
|
||||
protected boolean isLinkSupported(@NonNull Uri data)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
protected MapTask createTargetTask(@NonNull String url)
|
||||
|
@ -444,7 +473,19 @@ public class Factory
|
|||
Uri coreUri = uri.buildUpon()
|
||||
.scheme(SCHEME_CORE)
|
||||
.authority("").build();
|
||||
return BackUrlMapTaskWrapper.wrap(new OpenUrlTask(coreUri.toString()), url);
|
||||
|
||||
String query = coreUri.getLastPathSegment();
|
||||
MapTask statisticTask = StatisticMapTaskWrapper.wrap(new OpenUrlTask(coreUri.toString(),
|
||||
TextUtils.isEmpty(query)
|
||||
? Statistics.ParamValue.UNKNOWN :
|
||||
query));
|
||||
return BackUrlMapTaskWrapper.wrap(statisticTask, url);
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean isLinkSupported(@NonNull Uri data)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
@ -515,7 +556,7 @@ public class Factory
|
|||
org.alohalytics.Statistics.logEvent("OpenCountryTaskProcessor::process",
|
||||
new String[] { "autoDownload", "false" },
|
||||
LocationHelper.INSTANCE.getSavedLocation());
|
||||
return new ShowCountryTask(countryId);
|
||||
return StatisticMapTaskWrapper.wrap(new ShowCountryTask(countryId));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -650,7 +691,7 @@ public class Factory
|
|||
double lat = getCoordinateFromIntent(intent, EXTRA_LAT);
|
||||
double lon = getCoordinateFromIntent(intent, EXTRA_LON);
|
||||
|
||||
return new ShowPointTask(lat, lon);
|
||||
return StatisticMapTaskWrapper.wrap(new ShowPointTask(lat, lon));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -754,6 +795,13 @@ public class Factory
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String toStatisticValue()
|
||||
{
|
||||
return "subscription";
|
||||
}
|
||||
}
|
||||
|
||||
public static class ImportBookmarkCatalogueTask implements MapTask
|
||||
|
@ -773,6 +821,13 @@ public class Factory
|
|||
BookmarkCategoriesActivity.startForResult(target, BookmarksPageFactory.DOWNLOADED.ordinal(), mUrl);
|
||||
return true;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String toStatisticValue()
|
||||
{
|
||||
return "catalogue";
|
||||
}
|
||||
}
|
||||
|
||||
public static class GuidesPageToOpenTask extends BaseUrlTask
|
||||
|
@ -791,6 +846,13 @@ public class Factory
|
|||
BookmarksCatalogActivity.start(target, deeplink);
|
||||
return true;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String toStatisticValue()
|
||||
{
|
||||
return "guides_page";
|
||||
}
|
||||
}
|
||||
|
||||
static class FreeGuideReadyToDownloadIntroductionTask extends BaseUrlTask
|
||||
|
@ -808,6 +870,13 @@ public class Factory
|
|||
target.showIntroductionScreenForDeeplink(getUrl(), IntroductionScreenFactory.FREE_GUIDE);
|
||||
return true;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String toStatisticValue()
|
||||
{
|
||||
throw new UnsupportedOperationException("This task not statistic tracked!");
|
||||
}
|
||||
}
|
||||
|
||||
public static class GuidesPageToOpenIntroductionTask extends BaseUrlTask
|
||||
|
@ -826,6 +895,13 @@ public class Factory
|
|||
target.showIntroductionScreenForDeeplink(deeplink, IntroductionScreenFactory.GUIDES_PAGE);
|
||||
return true;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String toStatisticValue()
|
||||
{
|
||||
throw new UnsupportedOperationException("This task not statistic tracked!");
|
||||
}
|
||||
}
|
||||
|
||||
abstract static class BaseUrlTask implements MapTask
|
||||
|
@ -850,12 +926,16 @@ public class Factory
|
|||
{
|
||||
private static final long serialVersionUID = -7257820771228127413L;
|
||||
private static final int SEARCH_IN_VIEWPORT_ZOOM = 16;
|
||||
@NonNull
|
||||
private final String mUrl;
|
||||
@NonNull
|
||||
private final String mStatisticValue;
|
||||
|
||||
OpenUrlTask(String url)
|
||||
OpenUrlTask(@NonNull String url, @NonNull String statisticValue)
|
||||
{
|
||||
Utils.checkNotNull(url);
|
||||
mUrl = url;
|
||||
mStatisticValue = statisticValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -902,6 +982,13 @@ public class Factory
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String toStatisticValue()
|
||||
{
|
||||
return mStatisticValue;
|
||||
}
|
||||
}
|
||||
|
||||
public static class ShowCountryTask implements MapTask
|
||||
|
@ -920,9 +1007,16 @@ public class Factory
|
|||
Framework.nativeShowCountry(mCountryId, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String toStatisticValue()
|
||||
{
|
||||
return "open_country";
|
||||
}
|
||||
}
|
||||
|
||||
public static class ShowBookmarkCategoryTask implements MapTask
|
||||
public static class ShowBookmarkCategoryTask extends RegularMapTask
|
||||
{
|
||||
private static final long serialVersionUID = 8285565041410550281L;
|
||||
final long mCategoryId;
|
||||
|
@ -939,7 +1033,7 @@ public class Factory
|
|||
}
|
||||
}
|
||||
|
||||
static abstract class BaseUserMarkTask implements MapTask
|
||||
static abstract class BaseUserMarkTask extends RegularMapTask
|
||||
{
|
||||
private static final long serialVersionUID = -3348320422813422144L;
|
||||
final long mCategoryId;
|
||||
|
@ -1005,6 +1099,13 @@ public class Factory
|
|||
"mapsme://map?ll=%f,%f", mLat, mLon));
|
||||
return true;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String toStatisticValue()
|
||||
{
|
||||
return "show_on_map_intent";
|
||||
}
|
||||
}
|
||||
|
||||
public static class BuildRouteTask implements MapTask
|
||||
|
@ -1103,9 +1204,16 @@ public class Factory
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String toStatisticValue()
|
||||
{
|
||||
return "build_route_intent";
|
||||
}
|
||||
}
|
||||
|
||||
public static class RestoreRouteTask implements MapTask
|
||||
public static class RestoreRouteTask extends RegularMapTask
|
||||
{
|
||||
private static final long serialVersionUID = 6123893958975977040L;
|
||||
|
||||
|
@ -1117,7 +1225,7 @@ public class Factory
|
|||
}
|
||||
}
|
||||
|
||||
public static class ShowUGCEditorTask implements MapTask
|
||||
public static class ShowUGCEditorTask extends RegularMapTask
|
||||
{
|
||||
private static final long serialVersionUID = 1636712824900113568L;
|
||||
// Nullable because of possible serialization from previous incompatible version of class.
|
||||
|
@ -1148,7 +1256,7 @@ public class Factory
|
|||
}
|
||||
}
|
||||
|
||||
public static class ShowDialogTask implements MapTask
|
||||
public static class ShowDialogTask extends RegularMapTask
|
||||
{
|
||||
private static final long serialVersionUID = 1548931513812565018L;
|
||||
@NonNull
|
||||
|
|
|
@ -3,10 +3,11 @@ package com.mapswithme.maps.intent;
|
|||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.mapswithme.maps.MwmActivity;
|
||||
import com.mapswithme.util.statistics.StatisticValueConverter;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public interface MapTask extends Serializable
|
||||
public interface MapTask extends Serializable, StatisticValueConverter<String>
|
||||
{
|
||||
boolean run(@NonNull MwmActivity target);
|
||||
}
|
||||
|
|
15
android/src/com/mapswithme/maps/intent/RegularMapTask.java
Normal file
15
android/src/com/mapswithme/maps/intent/RegularMapTask.java
Normal file
|
@ -0,0 +1,15 @@
|
|||
package com.mapswithme.maps.intent;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
public abstract class RegularMapTask implements MapTask
|
||||
{
|
||||
private static final long serialVersionUID = -6799622370628032853L;
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String toStatisticValue()
|
||||
{
|
||||
throw new UnsupportedOperationException("This task '" + this + "' not tracked in statistic!");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
package com.mapswithme.maps.intent;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import com.mapswithme.maps.MwmActivity;
|
||||
import com.mapswithme.maps.MwmApplication;
|
||||
import com.mapswithme.util.statistics.Statistics;
|
||||
|
||||
public class StatisticMapTaskWrapper implements MapTask
|
||||
{
|
||||
private static final long serialVersionUID = 7604577952712453816L;
|
||||
@NonNull
|
||||
private final MapTask mMapTask;
|
||||
|
||||
private StatisticMapTaskWrapper(@NonNull MapTask mapTask)
|
||||
{
|
||||
mMapTask = mapTask;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean run(@NonNull MwmActivity target)
|
||||
{
|
||||
boolean success = mMapTask.run(target);
|
||||
boolean firstLaunch = MwmApplication.from(target).isFirstLaunch();
|
||||
if (success)
|
||||
Statistics.INSTANCE.trackDeeplinkEvent(Statistics.EventName.DEEPLINK_CALL,
|
||||
mMapTask.toStatisticValue(), firstLaunch);
|
||||
else
|
||||
Statistics.INSTANCE.trackDeeplinkEvent(Statistics.EventName.DEEPLINK_CALL_MISSED,
|
||||
toStatisticValue(), firstLaunch);
|
||||
return success;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String toStatisticValue()
|
||||
{
|
||||
return mMapTask.toStatisticValue();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
static MapTask wrap(@NonNull MapTask task)
|
||||
{
|
||||
return new StatisticMapTaskWrapper(task);
|
||||
}
|
||||
}
|
|
@ -6,12 +6,12 @@ import android.location.Location;
|
|||
import android.net.ConnectivityManager;
|
||||
import android.net.NetworkInfo;
|
||||
import android.os.Build;
|
||||
import androidx.annotation.IntDef;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Pair;
|
||||
|
||||
import androidx.annotation.IntDef;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import com.android.billingclient.api.BillingClient;
|
||||
import com.facebook.ads.AdError;
|
||||
import com.facebook.appevents.AppEventsLogger;
|
||||
|
@ -70,8 +70,8 @@ import static com.mapswithme.util.statistics.Statistics.EventName.BM_SYNC_PROPOS
|
|||
import static com.mapswithme.util.statistics.Statistics.EventName.BM_SYNC_SUCCESS;
|
||||
import static com.mapswithme.util.statistics.Statistics.EventName.DOWNLOADER_DIALOG_ERROR;
|
||||
import static com.mapswithme.util.statistics.Statistics.EventName.GUIDES_BOOKMARK_SELECT;
|
||||
import static com.mapswithme.util.statistics.Statistics.EventName.GUIDES_SHOWN;
|
||||
import static com.mapswithme.util.statistics.Statistics.EventName.GUIDES_OPEN;
|
||||
import static com.mapswithme.util.statistics.Statistics.EventName.GUIDES_SHOWN;
|
||||
import static com.mapswithme.util.statistics.Statistics.EventName.GUIDES_TRACK_SELECT;
|
||||
import static com.mapswithme.util.statistics.Statistics.EventName.INAPP_PURCHASE_PREVIEW_SELECT;
|
||||
import static com.mapswithme.util.statistics.Statistics.EventName.INAPP_PURCHASE_PREVIEW_SHOW;
|
||||
|
@ -111,6 +111,7 @@ import static com.mapswithme.util.statistics.Statistics.EventParam.ERROR;
|
|||
import static com.mapswithme.util.statistics.Statistics.EventParam.ERROR_CODE;
|
||||
import static com.mapswithme.util.statistics.Statistics.EventParam.ERROR_MESSAGE;
|
||||
import static com.mapswithme.util.statistics.Statistics.EventParam.FEATURE_ID;
|
||||
import static com.mapswithme.util.statistics.Statistics.EventParam.FIRST_LAUNCH;
|
||||
import static com.mapswithme.util.statistics.Statistics.EventParam.FROM;
|
||||
import static com.mapswithme.util.statistics.Statistics.EventParam.HAS_AUTH;
|
||||
import static com.mapswithme.util.statistics.Statistics.EventParam.HOTEL;
|
||||
|
@ -145,12 +146,15 @@ import static com.mapswithme.util.statistics.Statistics.ParamValue.BICYCLE;
|
|||
import static com.mapswithme.util.statistics.Statistics.ParamValue.BOOKING_COM;
|
||||
import static com.mapswithme.util.statistics.Statistics.ParamValue.DISK_NO_SPACE;
|
||||
import static com.mapswithme.util.statistics.Statistics.ParamValue.FACEBOOK;
|
||||
import static com.mapswithme.util.statistics.Statistics.ParamValue.FALSE;
|
||||
import static com.mapswithme.util.statistics.Statistics.ParamValue.GOOGLE;
|
||||
import static com.mapswithme.util.statistics.Statistics.ParamValue.HOLIDAY;
|
||||
import static com.mapswithme.util.statistics.Statistics.ParamValue.MAPSME;
|
||||
import static com.mapswithme.util.statistics.Statistics.ParamValue.MAPSME_GUIDES;
|
||||
import static com.mapswithme.util.statistics.Statistics.ParamValue.NO_BACKUP;
|
||||
import static com.mapswithme.util.statistics.Statistics.ParamValue.OFFSCREEEN;
|
||||
import static com.mapswithme.util.statistics.Statistics.ParamValue.OPENTABLE;
|
||||
import static com.mapswithme.util.statistics.Statistics.ParamValue.PARTNER;
|
||||
import static com.mapswithme.util.statistics.Statistics.ParamValue.PEDESTRIAN;
|
||||
import static com.mapswithme.util.statistics.Statistics.ParamValue.PHONE;
|
||||
import static com.mapswithme.util.statistics.Statistics.ParamValue.RESTORE;
|
||||
|
@ -158,10 +162,9 @@ import static com.mapswithme.util.statistics.Statistics.ParamValue.SEARCH_BOOKIN
|
|||
import static com.mapswithme.util.statistics.Statistics.ParamValue.TAXI;
|
||||
import static com.mapswithme.util.statistics.Statistics.ParamValue.TRAFFIC;
|
||||
import static com.mapswithme.util.statistics.Statistics.ParamValue.TRANSIT;
|
||||
import static com.mapswithme.util.statistics.Statistics.ParamValue.TRUE;
|
||||
import static com.mapswithme.util.statistics.Statistics.ParamValue.UNKNOWN;
|
||||
import static com.mapswithme.util.statistics.Statistics.ParamValue.VEHICLE;
|
||||
import static com.mapswithme.util.statistics.Statistics.ParamValue.MAPSME_GUIDES;
|
||||
import static com.mapswithme.util.statistics.Statistics.ParamValue.PARTNER;
|
||||
|
||||
public enum Statistics
|
||||
{
|
||||
|
@ -568,6 +571,9 @@ public enum Statistics
|
|||
public static final String MAP_SPONSORED_BUTTON_CLICK = "Map_SponsoredButton_click";
|
||||
public static final String MAP_SPONSORED_BUTTON_SHOW = "Map_SponsoredButton_show";
|
||||
|
||||
public static final String DEEPLINK_CALL = "Deeplink_call";
|
||||
public static final String DEEPLINK_CALL_MISSED = "Deeplink_call_missed";
|
||||
|
||||
public static class Settings
|
||||
{
|
||||
public static final String WEB_SITE = "Setings. Go to website";
|
||||
|
@ -678,6 +684,7 @@ public enum Statistics
|
|||
static final String SERVER_ID = "server_id";
|
||||
static final String SERVER_IDS = "server_ids";
|
||||
public static final String SOURCE = "source";
|
||||
static final String FIRST_LAUNCH = "first_launch";
|
||||
|
||||
private EventParam() {}
|
||||
}
|
||||
|
@ -773,6 +780,8 @@ public enum Statistics
|
|||
public static final String BOOKMARKS_LIST = "BookmarksList";
|
||||
static final String PARTNER = "Partner";
|
||||
public static final String WIKIPEDIA = "wikipedia";
|
||||
static final String TRUE = "True";
|
||||
static final String FALSE = "False";
|
||||
}
|
||||
|
||||
// Initialized once in constructor and does not change until the process restarts.
|
||||
|
@ -1761,6 +1770,11 @@ public enum Statistics
|
|||
trackEvent(GUIDES_TRACK_SELECT, params().add(SERVER_ID, serverId), STATISTICS_CHANNEL_REALTIME);
|
||||
}
|
||||
|
||||
public void trackDeeplinkEvent(@NonNull String event, @NonNull String type, boolean isFirstLaunch)
|
||||
{
|
||||
trackEvent(event, params().add(TYPE, type).add(FIRST_LAUNCH, isFirstLaunch ? TRUE : FALSE));
|
||||
}
|
||||
|
||||
public static ParameterBuilder params()
|
||||
{
|
||||
return new ParameterBuilder();
|
||||
|
|
Reference in a new issue