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
Field | Description | Required |
---|---|---|
eventType | Type of event (Regular, Error, Exception, Duration). | Required for all types |
actionName | Name of the action/event being tracked. | Required for all types |
payload | Data sent with the action. | Optional |
isSuccessful | Indicates if the action was successful. | Optional (Required with value false for Exception and Error events) |
apiResponseSizeInKilobytes | Size of the API response in kilobytes. | Optional |
apiResponseTimeInSeconds | Time taken for the API response in seconds. | Optional |
apiResponseSizeInMegabytes | Size of the API response in megabytes. | Optional |
startTime | Start time of the event. | Required for Duration events |
endTime | End time of the event. | Required for Duration events |
apiBaseUrl | Base URL of the API. | Optional |
ValidationErrors | Errors during validation. | Optional |
ReasonForfailure | Reason for failure of the action. | Required for Exception and Error events |
apiUrl | URL of the API. | Required for Error events |
apiStatusCode | Status code returned by the API. | Required for Error events |
apiStatus | Status of the API request. | Optional |
apiMethod | HTTP method used for the API request. | Optional (Required for Error events) |
apiRequest | Data sent in the API request. | Required for Error events |
apiResponse | Data received in the API response. | Required for Error events |
tapId | Identifier for a specific UI tap action. | Optional |
uiType | Type of the user interface. | Optional |
tapShortName | Short name of the tap action. | Optional |
tapName | Name of the tap action. | Optional |
appBuildNumber | Build number of the application. | Optional |
sectionName | Name of the section within the application. | Optional |
integrationAppName | Name of the integration app involved. | Optional |
appId | Identifier for the application. | Optional |
traceId | Identifier used for tracing requests and actions. | Optional |
os | Operating system on which the action occurred. | Optional |
viewId | Identifier for the specific view in the application. | Optional |
viewShortName | Short name of the view. | Optional |
searchResultFound | Indicates if the search yielded results. | Optional |
searchQuery | The search query entered by the user. | Optional |
searchShortName | Short name for the search action. | Optional |
searchId | Identifier for the search action. | Optional |
searchName | Name for the search action. | Optional |
productName | Name of the product involved in the action. | Optional |
searchSelectedResult | The result selected from the search results. | Optional |
purchasePaymentType | Type of payment used in a purchase. | Optional |
purchaseErrorMessage | Error message received during a purchase, if any. | Optional |
purchasePaymentChannel | Payment channel used in the purchase. | Optional |
purchaseAmount | Amount involved in a purchase. | Optional |
pageName | Name of the page where the action took place. | Optional |
viewName | Name of the view where the action took place. | Optional |
customerName | Name of the customer. | Optional |
customerEmail | Email of the customer. | Optional |
customerPhoneNumber | Phone number of the customer. | Optional |
location | Geographic location of the customer. | Optional |
customerId | Identifier for the customer. | Optional |
customerCountry | Country of the customer. | Optional |
CHAT SAMMIAT