From c3e710a86c9b6bed8a2b38146db55caffcf1df65 Mon Sep 17 00:00:00 2001 From: Oliver Date: Tue, 22 Apr 2025 18:37:30 +0200 Subject: [PATCH] docs: Add detailed explanation and examples for events in events.md --- docs/src/fancyanalytics/features/events.md | 26 +++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/docs/src/fancyanalytics/features/events.md b/docs/src/fancyanalytics/features/events.md index 08b0f0ca..cf66f99d 100644 --- a/docs/src/fancyanalytics/features/events.md +++ b/docs/src/fancyanalytics/features/events.md @@ -3,4 +3,28 @@ icon: dot order: 400 --- -TODO \ No newline at end of file +# Events + +**Events** are time-stamped, structured logs that describe something that **happened** in your application. +They are flexible, contextual, and great for tracking user behavior, system actions, feature usage, and more. + +## What is an Event? + +An **event** is: + +- Identified by an **event name** (e.g. `npc_spawned`, `command_used`, `plugin_loaded`) +- Has a **timestamp** +- Sent by a **sender** (e.g., server, client, device) +- It Can include any number of **properties** (flexible key-value pairs) + +Unlike metrics, events are **not numeric by default**, but rather represent **something that occurred**, and may include rich context. + +## Example Use Cases + +| Event Name | Properties | Description | +|---------------------|---------------------------------|------------------------------------------| +| `npc_spawned` | world_name, npc_type | Fired whenever an NPC is spawned in-game | +| `feature_flag_used` | feature_flag | Tracked when a feature is enabled/used | +| `plugin_loaded` | plugin_version, server_software | When the plugin successfully loads | +| `command_executed` | command, player | A player runs a specific command | +| `player_joined` | player, location | A player joins the server |