Represents an interface for metrics-related functionalities. Provides methods to retrieve metrics, log events, and handle event-based interactions.
Methods
(static) getDaysSinceRegistration(timestampopt) → {number}
Calculates the number of days that have passed since the user's registration. If the timestamp parameter is not provided, the current date and time (Date.now()) is used.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
timestamp | number | <optional> | Date.now() | The optional timestamp to calculate the difference from the registration time. |
The number of days since registration.
- Type:
- number
(static) setChannel(channel)
Sets the user acquisition channel
| Name | Type | Description |
|---|---|---|
channel | Object | The channel object to be set, which will be used for logging events |
(static) logEvent(name, params)
Logs an event with the specified name and parameters.
| Name | Type | Description |
|---|---|---|
name | string | The name of the event to be logged. |
params | Object | An object containing parameters associated with the event. |
(static) on(eventName, callback)
Attaches a listener for the specified event and executes the callback function when the event is triggered.
| Name | Type | Description |
|---|---|---|
eventName | string | The name of the event to listen for. |
callback | function | The callback function to execute when the event is triggered. |