Skip to content

Logging Analytic Events

This method can be used to log both analytics events and other types of events simultaneously. It serves as a comprehensive option and can ideally replace the use of other specific event logging methods, offering a unified way to track all events and associated analytics.

TIP

The logAnalyticsEvent method is recommended for logging all event types. It streamlines the process by posting events to both the Events Portal and the analytics endpoint simultaneously, making it more efficient than using individual methods which only post to Events Portal

Usage

Here's an example of how to log analytic event:

ts
eventPublisher.logAnalyticsEvent({
    eventType: "Regular",
    actionName: "Download_invoice",
    customerName: "Prince Nketiah"
    customerPhoneNumber: "0200000000",
    customerCountry: "GH"
})

TIP

For detailed instructions on setting up the event publisher, refer to the documentation.

Object Properties

FieldDescriptionRequired
eventTypeType of event (Regular, Error, Exception, Duration).Required for all types
actionNameName of the action/event being tracked.Required for all types
payloadData sent with the action.Optional
isSuccessfulIndicates if the action was successful.Optional (Required with value false for Exception and Error events)
apiResponseSizeInKilobytesSize of the API response in kilobytes.Optional
apiResponseTimeInSecondsTime taken for the API response in seconds.Optional
apiResponseSizeInMegabytesSize of the API response in megabytes.Optional
startTimeStart time of the event.Required for Duration events
endTimeEnd time of the event.Required for Duration events
apiBaseUrlBase URL of the API.Optional
ValidationErrorsErrors during validation.Optional
ReasonForfailureReason for failure of the action.Required for Exception and Error events
apiUrlURL of the API.Required for Error events
apiStatusCodeStatus code returned by the API.Required for Error events
apiStatusStatus of the API request.Optional
apiMethodHTTP method used for the API request.Optional (Required for Error events)
apiRequestData sent in the API request.Required for Error events
apiResponseData received in the API response.Required for Error events
tapIdIdentifier for a specific UI tap action.Optional
uiTypeType of the user interface.Optional
tapShortNameShort name of the tap action.Optional
tapNameName of the tap action.Optional
appBuildNumberBuild number of the application.Optional
sectionNameName of the section within the application.Optional
integrationAppNameName of the integration app involved.Optional
appIdIdentifier for the application.Optional
traceIdIdentifier used for tracing requests and actions.Optional
osOperating system on which the action occurred.Optional
viewIdIdentifier for the specific view in the application.Optional
viewShortNameShort name of the view.Optional
searchResultFoundIndicates if the search yielded results.Optional
searchQueryThe search query entered by the user.Optional
searchShortNameShort name for the search action.Optional
searchIdIdentifier for the search action.Optional
searchNameName for the search action.Optional
productNameName of the product involved in the action.Optional
searchSelectedResultThe result selected from the search results.Optional
purchasePaymentTypeType of payment used in a purchase.Optional
purchaseErrorMessageError message received during a purchase, if any.Optional
purchasePaymentChannelPayment channel used in the purchase.Optional
purchaseAmountAmount involved in a purchase.Optional
pageNameName of the page where the action took place.Optional
viewNameName of the view where the action took place.Optional
customerNameName of the customer.Optional
customerEmailEmail of the customer.Optional
customerPhoneNumberPhone number of the customer.Optional
locationGeographic location of the customer.Optional
customerIdIdentifier for the customer.Optional
customerCountryCountry of the customer.Optional