Official TopStats Analytics plugin for CS2 servers, built on
CounterStrikeSharp and the
TopStats.Analytics SDK.
Tracks automatically once an API key is set:
player_connected/player_droppedwith session duration and map - SteamID64 as the actor so name changes never split a player's history, bots ignored.round_endedwith winner and round number,map_changed.server_statsheartbeat: players online, max players, map, uptime.
- Install CounterStrikeSharp on the server.
- Drop the
TopStatsfolder from the latest release intoaddons/counterstrikesharp/plugins/. - Set the API key in
configs/plugins/TopStats/TopStats.json:
{
"api_key": "ts_live_...",
"source": "cs2",
"track_sessions": true,
"track_rounds": true,
"heartbeat_seconds": 60
}Create the key in your workspace under Settings, then API keys.
var topstats = // capability lookup for the TopStats plugin instance
topstats.Tracker?.Track("bomb_defused", new Dictionary<string, object?>
{
["site"] = "B",
}, steamId, playerName);The SDK buffers and batches off the game thread; nothing blocks a tick, and your API key never appears in logs.