Package com.dmperium.dmp.track
Class Tracker
java.lang.Object
com.dmperium.dmp.track.Tracker
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidreset()Resets tracker back to original state by clearing all previously set attributes.voidSends tracking event with all attributes previously set, to DMPerium.voidsetAttribute(String attributeName, String attributeValue) Sets a value for a given attribute in tracking event.voidSets (optionally) a value for GAID in tracking event - Google Advertisement ID, used to uniquely identify Android mobile devices.
-
Constructor Details
-
Tracker
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
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
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
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.
-