Skip to main content

Events and attributes tracking

There are two types of information that can be tracked (or logged, or fired) to better understand user behaviour: events and attributes:

  • event refers to something that has occurred at a random time
  • attribute defines the state of an object, user, or device at specific time

The Pulse Analytics Library categorizes events into different types, including builtin, standard, and custom. For more detailed information, please refer to the Fundamentals. The SDK provides various API approaches to track these events accordingly.

Send a custom event, attribute

PAanalytics.getInstance().logAttribute(Attribute(name = "name", value = "value"))
PAanalytics.getInstance().logEvent(AnalyticsEvent(type = "event_name").apply {
addParam("key", "value")
})

Tracking Network Requests with OkHttp3

If you want to track all request that is doing your OkHttp client just add PANetworkMonitoringEventListener event listener to it.

val httpClient = OkHttpClient.Builder()
.eventListenerFactory(PANetworkMonitoringEventListenerFactory.create())
.build()