Actions
Log Events

logEvent

logEvent action allows you to track analytics events and user interactions using either Firebase Analytics or MoEngage.

Properties

PropertyTypeDescriptionDefault
providerStringAnalytics provider ("firebase" or "moengage")"firebase"
operationStringOperation to perform (see provider-specific operations)"logEvent"
nameStringName of the event to track (required for Firebase and MoEngage trackEvent)-
parametersObjectAdditional parameters for events{}
valueAnyValue for MoEngage operations (location, user attributes etc)-
attributeKeyStringKey for MoEngage custom attributes-
logLevelenumLog level ("info", "debug", "fatal")"info"
onSuccessActionAction to execute on success-
onErrorActionAction to execute on error-
userIdStringUser ID for Firebase setUserId operation-

Firebase Provider

Firebase provider enables basic analytics event tracking and user identification.

Operations

logEvent (Default)

Logs an analytics event to Firebase. Requires name and optional parameters.

Button:
  label: Track Purchase 
  onTap:
    logEvent:
      name: purchase_complete
      parameters:
        amount: 99.99
        currency: USD

setUserId

Sets the user identifier for Firebase Analytics.

logEvent:
  provider: firebase
  operation: setUserId
  userId: "user123" 

MoEngage Provider

MoEngage provider enables comprehensive user engagement features including event tracking, user attributes, and in-app messaging.

MoEngage User Profile Operations

OperationDescriptionRequired Properties
setUniqueIdSets a unique identifier for a user. This should be a unique and consistent identifier for the user across sessions.value (String)
setUserNameTracks full name as a user attribute.value (String)
setFirstNameTracks first name portion as a separate user attribute.value (String)
setLastNameTracks last name portion as a separate user attribute.value (String)
setEmailTracks user's email ID as attribute for communication and identification.value (String)
setPhoneNumberTracks user's phone number as attribute for communication.value (String)
setBirthDateSets user's birth date. Must be in ISO format: yyyy-MM-dd'T'HH:mm:ss.fff'Z'value (ISO date string)
setGenderSets user's gender for demographic data.value (enum: male/female)
setAliasUpdates user's unique ID that was previously set via setUniqueId. Use this to migrate IDs.value (String)
setLocationSets user's geographic location for location-based targeting.value (Object: {latitude: number, longitude: number})
setAppStatusIndicates whether this is a fresh install or app update.value (enum: install/update)

MoEngage Custom Attributes

OperationDescriptionRequired Properties
customSets a custom user attribute. Supports primitive types (String, Number, Boolean), arrays of primitives, and valid JSON objects/arrays. Cannot be empty.attributeKey (String), value (Any supported type)
timestampSets a date/time attribute in ISO format.attributeKey (String), value (ISO date string)
locationAttributeSets a location-based attribute for geo-targeting.attributeKey (String), value ({latitude: number, longitude: number})

MoEngage Event & Campaign Operations

OperationDescriptionRequired Properties
trackEventTracks an analytics event with optional properties. Properties support same types as custom attributes.name (String), parameters (Object, optional)
showInAppShows an in-app message if one is available.None
showNudgeShows a non-intrusive nudge notification. If position not specified, uses default position.value (enum: top, bottom, bottomLeft, bottomRight, any)
setContextSets the current context for in-app message targeting. Contexts determine when messages can be shown.value (String[])
resetContextRemoves all previously set contexts for in-app targeting.None

MoEngage Push Notification Operations

OperationDescriptionRequired Properties
registerForPushRegisters for push notifications (iOS only).None
registerForProvisionalPushRegisters for provisional push notifications (iOS only).None
passFCMTokenPasses Firebase Cloud Messaging token to SDK (Android only).value (String - FCM token)
passPushKitTokenPasses PushKit token to SDK (Android only).value (String - PushKit token)
passFCMPushPayloadPasses FCM push notification payload to SDK (Android only).value (Object - FCM payload)
requestPushPermissionRequests push notification permission (Android 13+).None
updatePermissionCountUpdates count of permission requests made.value (Number)
pushPermissionResponseNotifies SDK about push permission response.value (Boolean)

MoEngage SDK Configuration Operations

OperationDescriptionRequired Properties
enableSdkEnables all SDK features. By default enabled.None
disableSdkDisables all SDK features.None
enableDataTrackingEnables analytics tracking. By default enabled.None
disableDataTrackingDisables all analytics tracking. No events/attributes will be tracked.None
enableDeviceIdTrackingEnables device ID tracking (Android only). By default enabled.None
disableDeviceIdTrackingDisables device ID tracking (Android only).None
enableAndroidIdTrackingEnables Android ID tracking. By default disabled.None
disableAndroidIdTrackingDisables Android ID tracking.None
enableAdIdTrackingEnables advertising ID tracking. By default disabled.None
disableAdIdTrackingDisables advertising ID tracking.None
logoutInvalidates current user session and creates new one.None
deleteUserDeletes current user data from MoEngage (Android only). Returns UserDeletionData.None

Examples

Track Event

logEvent:
  provider: moengage
  operation: trackEvent
  name: "level_complete"
  parameters:
    level: 5
    score: 1000

Set User Profile

logEvent:
  provider: moengage
  operation: setUserName
  value: "John Smith"
  onSuccess: |
    //@code
    console.log("User name updated")

Show In-App Message

logEvent:
  provider: moengage
  operation: showInApp