Class MyTrackerParams

java.lang.Object
com.my.tracker.MyTrackerParams

public final class MyTrackerParams extends Object
Class for specifying additional tracking parameters
  • Method Details

    • getAge

      public int getAge()
      Return age of the current user.
      Returns:
      The user's age.
    • setAge

      public MyTrackerParams setAge(int age)
      Set age for the current user.
      Parameters:
      age - User's age.
      Returns:
      The current instance of MyTrackerParams.
    • getGender

      public int getGender()
      Return gender of the current user. Possible values are defined in MyTrackerParams.Gender
      Returns:
      The user's gender. Value is MyTrackerParams.Gender.UNKNOWN, MyTrackerParams.Gender.MALE, MyTrackerParams.Gender.FEMALE, or MyTrackerParams.Gender.UNSPECIFIED
    • setGender

      public MyTrackerParams setGender(int gender)
      Set gender for the current user.
      Parameters:
      gender - User's gender value that defined in MyTrackerParams.Gender. Value is MyTrackerParams.Gender.UNKNOWN, MyTrackerParams.Gender.MALE, MyTrackerParams.Gender.FEMALE, or MyTrackerParams.Gender.UNSPECIFIED
      Returns:
      The current instance of MyTrackerParams.
    • getLang

      public String getLang()
      Return current language. The value can differ from the current language of the system.
      Returns:
      Current language.
    • setLang

      public MyTrackerParams setLang(String lang)
      Set current language. You could use this method to override the system value of the language.
      Parameters:
      lang - Current language.
      Returns:
      The current instance of MyTrackerParams.
    • getMrgsAppId

      public String getMrgsAppId()
      Return MRGS application id.
      Returns:
      MRGS application id.
    • setMrgsAppId

      public MyTrackerParams setMrgsAppId(String appId)
      Set MRGS application id.
      Parameters:
      appId - MRGS application id.
      Returns:
      The current instance of MyTrackerParams.
    • getMrgsId

      public String getMrgsId()
      Return current MRGS device id.
      Returns:
      MRGS device id.
    • setMrgsId

      public MyTrackerParams setMrgsId(String mrgsId)
      Set MRGS device id.
      Parameters:
      mrgsId - MRGS device id.
      Returns:
      The current instance of MyTrackerParams.
    • getMrgsUserId

      public String getMrgsUserId()
      Return MRGS id of the current user.
      Returns:
      The current user's MRGS id.
    • setMrgsUserId

      public MyTrackerParams setMrgsUserId(String userId)
      Set MRGS id for the current user.
      Parameters:
      userId - User's MRGS id.
      Returns:
      The current instance of MyTrackerParams.
    • getCustomUserId

      public String getCustomUserId()
      Return identifier of the current user. If setCustomUserIds(String[]) was called, then the first array item will be returned.
      Returns:
      first user's id or null.
    • setCustomUserId

      public MyTrackerParams setCustomUserId(String id)
      Set identifier of the current user. This method overrides the value of setCustomUserIds(String[]).

      If custom user ids are changed, then myTracker will send all saved events to the server (with previous custom ids).

      Parameters:
      id - user's identifier or null.
      Returns:
      The current instance of MyTrackerParams.
    • getCustomUserIds

      public String[] getCustomUserIds()
      Return identifiers of the current user. If setCustomUserId(String) was called, then single item array will be returned.

      Don't change this array - it contains independent copy of data. Use setCustomUserId(String) or setCustomUserIds(String[]) to change custom user identifiers.

      Returns:
      user's identifiers or null.
    • setCustomUserIds

      public MyTrackerParams setCustomUserIds(String[] ids)
      Set identifiers of the current user. This method overrides the value of setCustomUserId(String).

      If custom user ids are changed, then myTracker will send all saved events to the server (with previous custom ids).

      Parameters:
      ids - user's identifiers or null. Zero-length array is replaced with null.
      Returns:
      The current instance of MyTrackerParams.
    • getEmail

      public String getEmail()
      Return email of the current user. If setEmails(String[]) was called, then the first email will be returned.
      Returns:
      first user's email or null.
    • setEmail

      public MyTrackerParams setEmail(String email)
      Set email of the current user. This method overrides the value of setEmails(String[]).
      Parameters:
      email - user's email or null.
      Returns:
      The current instance of MyTrackerParams.
    • getEmails

      public String[] getEmails()
      Return emails of the current user. If setEmail(String) was called, then single item array will be returned.

      Don't change this array - it contains independent copy of data. Use setEmail(String) or setEmails(String[]) to change user emails.

      Returns:
      user's emails or null.
    • setEmails

      public MyTrackerParams setEmails(String[] emails)
      Set emails of the current user. This method overrides the value if setEmail(String).
      Parameters:
      emails - user's emails or null. Zero-length array is replaced with null.
      Returns:
      The current instance of MyTrackerParams.
    • getIcqId

      public String getIcqId()
      Return ICQ id of the current user. If setIcqIds(String[]) was called, then the first id will be returned.
      Returns:
      first user's ICQ id or null.
    • setIcqId

      public MyTrackerParams setIcqId(String id)
      Set ICQ id of the current user. This method overrides the value of setIcqIds(String[]).
      Parameters:
      id - user's ICQ id or null.
      Returns:
      The current instance of MyTrackerParams.
    • getIcqIds

      public String[] getIcqIds()
      Return ICQ ids of the current user. If setIcqId(String) was called, then single item array will be returned.

      Don't change this array - it contains independent copy of data. Use setIcqId(String) or setIcqIds(String[]) to change user ICQ ids.

      Returns:
      user's ICQ ids or null.
    • setIcqIds

      public MyTrackerParams setIcqIds(String[] ids)
      Set ICQ ids of the current user. This method overrides the value if setIcqId(String).
      Parameters:
      ids - user's ICQ ids or null. Zero-length array is replaced with null.
      Returns:
      The current instance of MyTrackerParams.
    • getOkId

      public String getOkId()
      Return OK id of the current user. If setOkIds(String[]) was called, then the first id will be returned.
      Returns:
      first user's OK id or null.
    • setOkId

      public MyTrackerParams setOkId(String id)
      Set OK id of the current user. This method overrides the value of setOkIds(String[]).
      Parameters:
      id - user's OK id or null.
      Returns:
      The current instance of MyTrackerParams.
    • getOkIds

      public String[] getOkIds()
      Return OK ids of the current user. If setOkId(String) was called, then single item array will be returned.

      Don't change this array - it contains independent copy of data. Use setOkId(String) or setOkIds(String[]) to change user OK ids.

      Returns:
      user's OK ids or null.
    • setOkIds

      public MyTrackerParams setOkIds(String[] ids)
      Set OK ids of the current user. This method overrides the value if setOkId(String) (String)}.
      Parameters:
      ids - user's OK ids or null. Zero-length array is replaced with null.
      Returns:
      The current instance of MyTrackerParams.
    • getVkId

      public String getVkId()
      Return VK id of the current user. If setVkIds(String[]) was called, then the first id will be returned.
      Returns:
      first user's VK id or null.
    • setVkId

      public MyTrackerParams setVkId(String id)
      Set VK id of the current user. This method overrides the value of setVkIds(String[]).
      Parameters:
      id - user's VK id or null.
      Returns:
      The current instance of MyTrackerParams.
    • getVkIds

      public String[] getVkIds()
      Return VK ids of the current user. If setVkId(String) was called, then single item array will be returned.

      Don't change this array - it contains independent copy of data. Use setVkId(String) or setVkIds(String[]) to change user VK ids.

      Returns:
      user's VK ids or null.
    • setVkIds

      public MyTrackerParams setVkIds(String[] ids)
      Set VK ids of the current user. This method overrides the value if setVkId(String) (String)}.
      Parameters:
      ids - user's VK ids or null. Zero-length array is replaced with null.
      Returns:
      The current instance of MyTrackerParams.
    • getPhone

      public String getPhone()
      Return phone of the current user. If setPhones(String[]) was called, then the first phone will be returned.
      Returns:
      first user's phone number or null.
    • setPhone

      public MyTrackerParams setPhone(String phone)
      Set phone of the current user. This method overrides the value of setPhones(String[]).
      Parameters:
      phone - user's phone number or null.
      Returns:
      The current instance of MyTrackerParams.
    • getPhones

      public String[] getPhones()
      Return phone numbers of the current user. If setPhone(String) was called, then single item array will be returned.

      Don't change this array - it contains independent copy of data. Use setPhone(String) or setPhones(String[]) to change user phone numbers.

      Returns:
      user's phone numbers or null.
    • setPhones

      public MyTrackerParams setPhones(String[] phones)
      Set phones of the current user. This method overrides the value if setPhone(String) (String)}.
      Parameters:
      phones - user's phone numbers or null. Zero-length array is replaced with null.
      Returns:
      The current instance of MyTrackerParams.
    • getVkConnectId

      public String getVkConnectId()
      Return VK connect id of the current user. If setVkConnectIds(String[]) was called, then the first id will be returned.
      Returns:
      first user's VK connect id or null.
    • setVkConnectId

      public MyTrackerParams setVkConnectId(String id)
      Set VK connect id of the current user. This method overrides the value * of setVkIds(String[]).
      Parameters:
      id - user's VK connect id or null.
      Returns:
      The current instance of MyTrackerParams.
    • getVkConnectIds

      public String[] getVkConnectIds()
      Return VK connect ids of the current user. If setVkConnectId(String) was called, then single item array will be returned.

      Don't change this array - it contains independent copy of data. Use setVkConnectId(String) or setVkConnectIds(String[]) to change user VK connect ids.

      Returns:
      user's VK connect ids or null.
    • setVkConnectIds

      public MyTrackerParams setVkConnectIds(String[] ids)
      Set VK connect ids of the current user. This method overrides the value if setVkConnectId(String) (String)} (String)}.
      Parameters:
      ids - user VK connect ids or null. Zero-length array is replaced with null.
      Returns:
      The current instance of MyTrackerParams.
    • setCustomParam

      public MyTrackerParams setCustomParam(String key, String value)
      Set custom param for sending data.

      Use null value to remove specified param.

      Parameters:
      key - param key(case insensitive)
      value - param value or null
    • getCustomParam

      public String getCustomParam(String key)
      Return custom param previously set with setCustomParam(String, String) or null.
      Parameters:
      key - param key (case insensitive)
      Returns:
      param value or null