Track events in real-time by incrementing metric values
incrementMetric
function allows you to track individual events as they occur, automatically updating aggregated values across all configured time units.
string
: The entity type being tracked (e.g., “product”, “user”, “article”)string
: The action being measured (e.g., “purchase”, “view”, “click”, “share”)string
: The specific entity ID (e.g., product ID, user ID)number
: Number of occurrences (default: 1)number
: Numerical value associated with the event (default: 1)firestore.Timestamp
: When the event occurred (default: current time)incrementMetric
, ensure the metric is configured with appropriate time units and timezone:
updateMetric
for importing large datasets