Skip to main content

Events

Events record what a contact does in your app. They appear on the contact's timeline and can start automations and build segments.


What it is​

The SDKs send three kinds of events:

KindUse forIn the panel
Custom eventAny action specific to your appAn event with your name and attributes
Screen eventA screen the contact openedScreen activity, matched by screen name
Product eventA commerce action on a product (view, add to cart, purchase...)A product event, plus product attributes

How it works​

Conditions​

  • The device needs a contact first. Events are recorded only after the first successful ping of an installation. See Contacts.
  • Each event carries the time it was created. Events sent later from the offline queue keep that time. Exception: Flutter screen events carry no time, so they get the time the backend receives them.

Event names​

  • Use the same spelling and letter case every time. Purchase and purchase (or Sign up and sign_up) count as the same name, and the second spelling is rejected.
  • Keep names 255 characters or fewer, without HTML.

Event attributes​

  • Every new attribute name creates a new event attribute. Use a fixed set of names.
  • The first value of an attribute sets its type for good. A later value of another type is dropped, while the event itself is still recorded.
  • Do not send null values or empty attribute names.
  • Content that looks like an attack (for example SQL or path fragments typed by users) can be blocked by the firewall, and the event is lost.

Product events​

  • The product ID is required.
  • The event type is one of a fixed list: add to cart, purchase, liking, add to observation, order, reservation, return, view, click, detail, add, remove, checkout, checkout option, refund, promo click.
  • Extra parameters are stored as product attributes. A new value replaces the previous value of that attribute on the product.
  • Two events with the same product, the same type and the same timestamp are recorded as one.

Screen events​

Automations and segments match screen events by screen name only. Use stable, readable names.


Platform differences​

iOSAndroidFlutter
Automatic screen trackingNo. Call trackScreen or use Trackable view controllers.Optional, with trackAllActivities in the builderOptional, with UserSdkNavigatorObserver for named routes
Event before the first pingNot sent. The completion reports an error.Sent without a contact key and rejected, then saved and sent again with the key on the next UserCom.getInstance() callSent and rejected
Result reported to your codeCompletion handler with Bool and ErrorNo result for eventsNo result for events

Platform guides​