Skip to main content

User behavior tracking

There are two types of information that can be tracked (or logged, or fired) to better understand user behavior in all supported platforms: iOS, Android, Web. They are an event and an attribute:

  • 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 Analytics platform 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.

Logging custom events

Event is for marking when something happens, it has event_name and optionally attached to it a dictionary of additional fields called data.

Most straightforward way to log an custom simple event in iOS is by calling:
PAAnalytics.logEvent(event_name)

When there is data dictionary with parameters associated with an event, you can use the following call:

PAAnalytics.logEvent(event_name, data: data)

Logging attributes

Attribute is only one value connected to attribute_name.

By default attributes logging feature is disabled. Please reach out your manager to get more details or enable this feature.

To log certain attribute in iOS call the following method:
PAAnalytics.logAttribute(attribute_name, value: value)

Full description about attribute tracking configuration in iOS you can find at Advanced configuration).

Keep in mind

Before logging a new event or attribute, make sure that the event name and corresponding structure for data parameters are defined and approved in the dashboard Picsart Tools. Otherwise, the analytics backend will ignore this event or attribute.