Custom Events

class urbanairship.custom_events.custom_events.CustomEvent(airship: BaseClient, name: str, user: Dict, interaction_type: str | None = None, interaction_id: str | None = None, properties: Dict | None = None, session_id: str | None = None, transaction: str | None = None, value: int | float | None = None, occurred: datetime | None = None)

A class representing an Airship custom event. Please see the documentation at https://docs.airship.com/api/ua/?http#tag-custom-events for details on Custom Event usage.

Parameters:
  • Airship – [required] An urbanairship.Airship instance initialized with bearer token authentication.

  • name – [required] A plain-text name for the event. Airship’s analytics systems will roll up events with the same name, providing counts and total value associated with the event. This value cannot contain upper-case characters. If the name contains upper-case characters, you will receive a 400 response.

  • user – [required] An Airship channel identifier or named user for the user who triggered the event.

  • interaction_id – [optional] The identifier defining where the event occurred.

  • interaction_type – [optional] Describes the type of interaction that triggered the event

  • properties – [optional] A dict containing custom event properties.

  • session_id – [optional] The user session during which the event occurred. You must supply and maintain session identifiers.

  • transaction – [optional] If the event is one in a series representing a single transaction, use the transaction field to tie events together.

  • value – [optional] If the event is associated with a count or amount, the ‘value’ field carries that information.

  • occurred – [optional] The date and time when the event occurred. Events must have occurred within the past 90 days. You cannot provide a future datetime.

send() Dict

Send the Custom Event to Airship systems

Returns:

API response dict