Class Tracker

java.lang.Object
com.dmperium.dmp.track.Tracker

public class Tracker extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
    Tracker(String dataSourceId)
    Tracker is used to form and send tracking events to DMPerium.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Resets tracker back to original state by clearing all previously set attributes.
    void
    Sends tracking event with all attributes previously set, to DMPerium.
    void
    setAttribute(String attributeName, String attributeValue)
    Sets a value for a given attribute in tracking event.
    void
    Sets (optionally) a value for GAID in tracking event - Google Advertisement ID, used to uniquely identify Android mobile devices.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Tracker

      public Tracker(String dataSourceId) throws Exception
      Tracker is used to form and send tracking events to DMPerium. It is initialized with 10-digit numeric data source ID which is automatically generated when data source is created in DMP dashboard.
      Parameters:
      dataSourceId -
      Throws:
      Exception
  • Method Details

    • setAttribute

      public void setAttribute(String attributeName, String attributeValue) throws Exception
      Sets a value for a given attribute in tracking event. Attribute name should correspond to one of attributes in DMP dashboard, associated with data source ID that is used on Tracker initialization.
      Parameters:
      attributeName -
      attributeValue -
      Throws:
      Exception
    • setGAID

      public void setGAID(String gaid) throws Exception
      Sets (optionally) a value for GAID in tracking event - Google Advertisement ID, used to uniquely identify Android mobile devices. GAID is one of default non-deletable attributes created together with data source in DMP dashboard. For GAID retrieval method, see this link: https://stackoverflow.com/questions/25846108/how-to-get-advertising-id-in-android-programmatically
      Parameters:
      gaid -
      Throws:
      Exception
    • sendTrackingEvent

      public void sendTrackingEvent() throws Exception
      Sends tracking event with all attributes previously set, to DMPerium. Tracking event is HTTPS GET request with connect and read timeouts of 3 seconds.
      Throws:
      Exception
    • reset

      public void reset()
      Resets tracker back to original state by clearing all previously set attributes. This method should be called prior to setting attributes for a new tracking event.