Class MyTrackerConfig

java.lang.Object
com.my.tracker.MyTrackerConfig

public final class MyTrackerConfig extends Object
Class for configuring myTracker
  • Method Details

    • getId

      @AnyThread @NonNull public String getId()
      Return identifier that was provided in MyTracker.initTracker(String, Application).
      Returns:
      Your identifier.
    • getBufferingPeriod

      @AnyThread public int getBufferingPeriod()
      Return buffering period. During this period every tracked event is stored in local storage.

      The value is in range [1 - 86400]. Default value is 900 seconds.

      Returns:
      Buffering period.
    • setBufferingPeriod

      @AnyThread @NonNull public MyTrackerConfig setBufferingPeriod(int bufferingPeriodSec)
      Set the buffering period.

      NOTE: it's recommended to call this method before MyTracker.initTracker(String, Application) call.

      Parameters:
      bufferingPeriodSec - Buffering period in seconds. The value should be in range [1 - 86400]. Otherwise it will be rejected.
      Returns:
      The current instance of MyTrackerConfig.
    • getAntiFraudConfig

      @AnyThread @NonNull public AntiFraudConfig getAntiFraudConfig()
      Return current anti-fraud configuration.
      Returns:
      The current instance of AntiFraudConfig.
    • setAntiFraudConfig

      @AnyThread public void setAntiFraudConfig(@NonNull AntiFraudConfig antiFraudConfig)
      Set anti-fraud configuration.
      Parameters:
      antiFraudConfig - Implementation of MyTrackerConfig.OkHttpClientProvider
    • getForcingPeriod

      @AnyThread public int getForcingPeriod()
      Return forcing period in seconds. During this period every tracked event leads to flushing tracker. The start of the period is install or update of application.

      The value is in range [0 - 432000]. Default value is 0. It means, that forcing period is disabled by default.

      Returns:
      Forcing period.
    • setForcingPeriod

      @AnyThread @NonNull public MyTrackerConfig setForcingPeriod(int forcingPeriodSec)
      Set the forcing period.

      NOTE: it's recommended to call this method before MyTracker.initTracker(String, Application) call.

      Parameters:
      forcingPeriodSec - Forcing period in seconds. The value should be in range [0 - 432000]. Otherwise it will be rejected.
      Returns:
      The current instance of MyTrackerConfig.
    • getLaunchTimeout

      @AnyThread public int getLaunchTimeout()
      Return launch timeout in in seconds. During this period start of the application after it close wont't be considered as new launch.

      The value is in range [30 - 7200]. Default value is 30.

      Returns:
      Launch timeout.
    • setLaunchTimeout

      @AnyThread @NonNull public MyTrackerConfig setLaunchTimeout(int seconds)
      Set the launch timeout.

      NOTE: it's recommended to call this method before MyTracker.initTracker(String, Application) call.

      Parameters:
      seconds - Launch timeout in seconds.
      Returns:
      The current instance of MyTrackerConfig.
    • setProxyHost

      @AnyThread @NonNull public MyTrackerConfig setProxyHost(@Nullable String proxyHost)
      Set the host to which all requests will be sent.

      Only host is allowed here (scheme, userinfo, path, query and fragment parts will be deleted), https schema is using anytime

      Example:

      [ok] exampleHost

      [ok] exampleHost:examplePort

      [ok] exampleHost.com

      [ok] exampleHost.com:examplePort

      [not ok] www.exampleHost.com (see note below)

      [not ok] ftp://exampleHost.com (https://exampleHost.com will be used)

      [not ok] exampleHost.com/examplePath (exampleHost.com will be used)

      [not ok] exampleUser:examplePass@exampleHost.com (exampleHost.com will be used)

      To reset proxy host to default call the method with null parameter.

      NOTE: it's mandatory to call this method before MyTracker.initTracker(String, Application) call.

      NOTE: we using subdomains for some of our queries. It means that for some cases result url can be 'subdomain.exampleHost.com'. Please don't use 'www' in proxy host, because result url will be 'subdomain.www.exampleHost.com' which is probably you don't want

      Parameters:
      proxyHost - Proxy host.
      Returns:
      The current instance of MyTrackerConfig.
    • getVendorAppPackage

      @AnyThread @Deprecated @Nullable public String getVendorAppPackage()
      Deprecated.
    • setVendorAppPackage

      @AnyThread @Deprecated @NonNull public MyTrackerConfig setVendorAppPackage(@Nullable String vendorAppPackage)
      Deprecated.
    • setDefaultVendorAppPackage

      @AnyThread @Deprecated @NonNull public MyTrackerConfig setDefaultVendorAppPackage()
      Deprecated.
    • setInstalledPackagesProvider

      @AnyThread @NonNull public MyTrackerConfig setInstalledPackagesProvider(@Nullable MyTrackerConfig.InstalledPackagesProvider provider)
      Set installed packages provider.
      Parameters:
      provider - Implementation of MyTrackerConfig.InstalledPackagesProvider
      Returns:
      The current instance of MyTrackerConfig.
    • isTrackingEnvironmentEnabled

      @AnyThread public boolean isTrackingEnvironmentEnabled()
      Return tracking environment state. Enabled state means that information about Wi-Fi and mobile networks will be collected.

      NOTE: this information are collected while sending request to the server. The impact to the battery is minimal.

      Returns:
      Tracking environment state.
    • setTrackingEnvironmentEnabled

      @AnyThread @NonNull public MyTrackerConfig setTrackingEnvironmentEnabled(boolean trackingEnvironmentEnabled)
      Enable or disable collecting environment information.

      NOTE: it's recommended to call this method before MyTracker.initTracker(String, Application) call.

      Parameters:
      trackingEnvironmentEnabled - The enable or disable state.
      Returns:
      The current instance of MyTrackerConfig.
    • isTrackingLaunchEnabled

      @AnyThread public boolean isTrackingLaunchEnabled()
      Return whether tracking application launches is enabled or not.
      Returns:
      The state of tracking launches feature.
    • setTrackingLaunchEnabled

      @AnyThread @NonNull public MyTrackerConfig setTrackingLaunchEnabled(boolean trackingLaunchEnabled)
      Enable or disable tracking application launches.

      NOTE: it's mandatory to call this method before MyTracker.initTracker(String, Application) call.

      Parameters:
      trackingLaunchEnabled - The enable or disable state.
      Returns:
      The current instance of MyTrackerConfig.
    • isTrackingLocationEnabled

      @AnyThread @Deprecated public boolean isTrackingLocationEnabled()
      Deprecated.
      This method is deprecated and will be removed in future versions.Use getLocationTrackingMode()} instead.

      NOTE: this information are collected while sending request to the server. The impact to the battery is minimal.

      Returns:
      The result of the MyTrackerConfig.getLocationTrackingMode() != LocationTrackingMode.NONE
    • setTrackingLocationEnabled

      @Deprecated @AnyThread @NonNull public MyTrackerConfig setTrackingLocationEnabled(boolean trackingLocationEnabled)
      Deprecated.
      This method is deprecated and will be removed in future versions. Use setLocationTrackingMode(int) ()}} instead. Now this works like setLocationTrackingMode(CACHED) or setLocationTrackingMode(NONE)

      NOTE: it's recommended to call this method before MyTracker.initTracker(String, Application) call.

      Parameters:
      trackingLocationEnabled - The enable or disable state.
      Returns:
      The current instance of MyTrackerConfig.
    • getLocationTrackingMode

      @AnyThread public int getLocationTrackingMode()
      Get geolocation tracking mode recommended to use instead isTrackingLocationEnabled() call.
      Returns:
      current locationTrackingMode value MyTrackerConfig.LocationTrackingMode. Possible values is MyTrackerConfig.LocationTrackingMode.NONE, MyTrackerConfig.LocationTrackingMode.CACHED, MyTrackerConfig.LocationTrackingMode.ACTIVE
    • setLocationTrackingMode

      @AnyThread @NonNull public MyTrackerConfig setLocationTrackingMode(int locationTrackingMode)
      Set geolocation tracking mode

      NOTE: it's recommended to call this method before MyTracker.initTracker(String, Application) and to use instead setTrackingLocationEnabled(boolean) call.

      Parameters:
      locationTrackingMode - value MyTrackerConfig.LocationTrackingMode. Possible values is MyTrackerConfig.LocationTrackingMode.NONE, MyTrackerConfig.LocationTrackingMode.CACHED, MyTrackerConfig.LocationTrackingMode.ACTIVE
    • isAutotrackingPurchaseEnabled

      @AnyThread public boolean isAutotrackingPurchaseEnabled()
      Return whether auto tracking purchases is enabled or not.

      If it's enabled: - The methods MyTracker.onActivityResult(int, Intent) and MyTracker.onPurchasesUpdated(int, List) are available for tracking. - The methods MyTracker.trackPurchaseEvent(JSONObject, JSONObject, String) and MyTracker.trackPurchaseEvent(JSONObject, JSONObject, String, Map) are disabled.

      If it's disabled: - The methods MyTracker.onActivityResult(int, Intent) and MyTracker.onPurchasesUpdated(int, List) are unavailable. for tracking. - The methods MyTracker.trackPurchaseEvent(JSONObject, JSONObject, String) and MyTracker.trackPurchaseEvent(JSONObject, JSONObject, String, Map) are enabled for tracking.

      Returns:
      The state of autotracking feature.
    • setAutotrackingPurchaseEnabled

      @AnyThread @NonNull public MyTrackerConfig setAutotrackingPurchaseEnabled(boolean autotrackingPurchaseEnabled)
      Enable or disable autotracking purchases.

      NOTE: it's recommended to call this method before MyTracker.initTracker(String, Application) call.

      Parameters:
      autotrackingPurchaseEnabled - The enable or disable state.
      Returns:
      The current instance of MyTrackerConfig.
    • isTrackingPreinstallEnabled

      @AnyThread public boolean isTrackingPreinstallEnabled()
      Return whether tracking preinstall of current application is enabled or not.
      Returns:
      The state of tracking preinstall feature.
    • setTrackingPreinstallEnabled

      @AnyThread @NonNull public MyTrackerConfig setTrackingPreinstallEnabled(boolean trackingPreinstallEnabled)
      Enable or disable tracking preinstall.

      NOTE: it's mandatory to call this method before MyTracker.initTracker(String, Application) call.

      Parameters:
      trackingPreinstallEnabled - The enable or disable state.
      Returns:
      The current instance of MyTrackerConfig.
    • isTrackingPreinstallThirdPartyEnabled

      @AnyThread public boolean isTrackingPreinstallThirdPartyEnabled()
      Return whether tracking preinstall of current application with third party sources is enabled or not.
      Returns:
      The state of tracking preinstall feature.
    • setTrackingPreinstallThirdPartyEnabled

      @AnyThread @NonNull public MyTrackerConfig setTrackingPreinstallThirdPartyEnabled(boolean trackingPreinstallThirdPartyEnabled)
      Enable or disable tracking preinstall with third party sources.

      NOTE: it's mandatory to call this method before MyTracker.initTracker(String, Application) call.

      Parameters:
      trackingPreinstallThirdPartyEnabled - The enable or disable state.
      Returns:
      The current instance of MyTrackerConfig.
    • setOkHttpClientProvider

      @AnyThread @NonNull public MyTrackerConfig setOkHttpClientProvider(@Nullable MyTrackerConfig.OkHttpClientProvider provider)
      Set installed okHttpClient provider.
      Parameters:
      provider - Implementation of MyTrackerConfig.OkHttpClientProvider
      Returns:
      The current instance of MyTrackerConfig.
    • getApkPreinstallParams

      @AnyThread @Nullable public String getApkPreinstallParams()
      Return apkPreinstallParams String
    • setApkPreinstallParams

      @AnyThread @NonNull public MyTrackerConfig setApkPreinstallParams(@Nullable String apkPreinstallParams)
      Set apkPreinstallParams
      Parameters:
      apkPreinstallParams - String
      Returns:
      The current instance of MyTrackerConfig.