Skip to main content

Analytics module for tracking custom events in your app. Use this module to track specific user actions. Track things like button clicks, form submissions, purchases, and feature usage.
Analytics events tracked with this module appear as custom event cards in the Analytics dashboard.
When tracking events:
  • Choose clear, descriptive event names in snake_case like signup_button_click or purchase_completed rather than generic names like click.
  • Include relevant context in your properties such as identifiers like product_id, measurements like price, and flags like is_first_purchase.
This module is only available in user authentication mode (base44.analytics).

Methods

track()

track(params): void
Tracks a custom event that appears as a card in your Analytics dashboard. Each unique event name becomes its own card showing total count and trends over time. This method returns immediately and events are sent in batches in the background.

Parameters

params
TrackEventParams
required
Event parameters.
eventName
string
required
Name of the event to track.Use descriptive names like button_click, form_submit, or purchase_completed.
properties
TrackEventProperties
Optional key-value pairs with additional event data.Values can be strings, numbers, booleans, or null.

Returns

void

Examples

base44.analytics.track({
  eventName: 'signup_button_click'
});