Skip to content
Logging Regular Events
Used for logging standard, one-time events that don't require additional tracking beyond the event itself. Typically for simple user actions or system occurrences.
Usage
ts
// shopInventory.ts
function examplePurchaseFunc() {
const payload = {
//...user payload
}
eventPublisher.logRegularEvent({
eventId: "PurchasedShopItem",
eventValue: {
type: "Object", //"String"|"Object"|"Decimal"|"Int"|"Double"
value: payload,
},
eventDescription: "Order purchase event",
sectionName: "EverydayEssentials",
subSectionName: "Shop",
userId: 02412345332,
userEmail: "[email protected]",
userName: "Addo Odame",
userLocationLat: 37.7749,
userLocationLong: 122.4194,
userLocationName: "Kokomlele",
userGender: "M",
userCountry: "GH",
extrasObject: {
zone: "Adenta-Lakeside",
station: "Madina",
},
});
}
TIP
For detailed instructions on setting up the event publisher, refer to the documentation.
Object Properties
Parameter Name | Description |
---|---|
eventValue | The value of the event. This is an object that includes type (the data type of the value) and value (the actual value). |
eventId | The unique identifier for the event. This should always be in PascalCase |
eventDescription | A description of the event. |
sectionName | The name of the section where the event occurred. |
subSectionName | The name of the subsection where the event occurred. |
userId | The unique identifier for the user. This is usually the user's phone number |
userEmail | The email of the user. |
userName | The name of the user. |
userLocationLat | The latitude of the user's location. |
userLocationLong | The longitude of the user's location. |
userLocationName | The name of the user's location. |
userGender | The gender of the user. |
userCountry | The country of the user. |
extrasObject | An object containing extra data for the event. These are product specific details that you'll want to record for every event |
CHAT SAMMIAT