☰
All featuresAttributionRetentionAudiencesAnalyticsIntegrationsGrow Steam wishlistsSteam Next FestCreator marketingLaunch on SteamAsk with AIFor game developersFor game studiosFor game publishersComparisonsPricingSecurityDocumentationFree toolsBlogGlossary
ANALYTICS TRACKING PLAN

Analytics tracking plan for a tower defense game

A tower defense plan adds waves to the level events: level_start, wave_end with lives left and enemies leaked, tower_built, level_complete with stars and level_fail with the wave. On Steam, 52.2% of Kingdom Rush players completed the campaign and 12.7% did so in Veteran mode (read 24 November 2026). Fails by wave find the spike.

What is the core loop of a tower defense game?

  1. Pick a level and a difficulty.
  2. Build and upgrade towers between and during waves.
  3. Hold the waves; leaked enemies cost lives.
  4. Win stars, unlock levels and upgrades, then try harder modes.

The wave is the unit inside a level, and the leak is the warning sign: a wave that leaks enemies predicts the wave that ends the level. Towers are few enough per level to send each build and upgrade, which shows the strategies players use. The level events keep their convention names, so you can filter Activity on level_fail by level.

Which events should a tower defense game send?

Send these 6 events from your game code, on top of the 6 core events every plan shares. Each event fires at one clear moment, and each answers one question.

Tower defense events: when to send each one, its properties with example values, and the question it answers.
EventWhenPropertiesQuestion it answers
level_startThe player starts a level.
level (number, e.g. 7)
attempt (number, e.g. 1)
difficulty (string, e.g. normal)
Which levels and difficulties do players try?
wave_endA wave ends.
level (number, e.g. 7)
wave (number, e.g. 9)
lives_left (number, e.g. 16)
leaked (number, e.g. 2)
gold (number, e.g. 340)
Which wave starts to leak?
tower_builtThe player builds or upgrades a tower.
level (number, e.g. 7)
wave (number, e.g. 3)
tower (string, e.g. archer)
tier (number, e.g. 2)
Which towers do players rely on?
early_wave_calledThe player calls the next wave early.
level (number, e.g. 7)
wave (number, e.g. 5)
Who finds a level too easy?
level_completeThe player wins the level.
level (number, e.g. 7)
attempt (number, e.g. 1)
score (number, e.g. 3)
stars (number, e.g. 3)
lives_left (number, e.g. 18)
How well do players win?
level_failThe player loses all lives or quits the level.
level (number, e.g. 7)
attempt (number, e.g. 2)
score (number, e.g. 0)
wave (number, e.g. 11)
At which wave do players lose?

The core events: game_open, session_start, session_end, tutorial_step, error, game_updated. The Godot, Unity, and Unreal SDKs send game_open, session_start, session_end and errors for you; the rest you send yourself. Property values are strings, numbers, booleans or null, with at most 50 properties per event. Keep names in snake_case and values in properties, never in event names.

Which KPIs matter for a tower defense game?

Tower defense KPIs, how to compute each one from the events, and why it matters.
KPIHow to compute itWhy it matters
Fail rate per levellevel_fail, divided by level_complete plus level_failCount both per level, then divide, or use SQL in the SQL Explorer (Pro).
Losing wavelevel_fail by level and waveFinds the wave that ends most attempts.
Leaks per waveSum of leaked in wave_end, by level and waveWarns of a spike before players fail.
Tower mixtower_built by tower, per levelShows dominant or unused towers.
Stars per completed levelAverage stars of level_completeShows how comfortable wins are.

From the core events alone, the Game KPIs dashboard template shows D1, D7 and D30 retention, DAU, MAU and session length, and the Game health template shows crash-free sessions, with no setup.

What should the tower defense dashboard show?

A suggested dashboard for a tower defense game: each chart, its kind, what it is built from and the question it answers.
ChartKindBuilt fromQuestion
Fails by waveSQL tablelevel_fail by level and waveWhich wave is the spike?
Fails by levelSQL tablelevel_fail and level_complete per level, then fails / (completes + fails), in the SQL Explorer (Pro)Which level is too hard?
Tower mixSQL bartower_built by towerIs one tower always the answer?
Campaign funnelFunnelgame_open, level_start, level_completeDo new players win the first level?
Retention after a lossRetentionEntry level_fail, return level_startDo players try again after losing?

A funnel has two to five steps of event names, and a retention chart takes an entry event and a return event. For the first chart, add a SQL chart with this query. It follows the dashboard date range, leaves out bots and server events, and counts each event once.

SQL chart: Fails by wave. At which level and wave do attempts end?

SELECT JSONExtractInt(properties,'level') AS level, JSONExtractInt(properties,'wave') AS wave, uniqExact(message_id) AS fails, uniqExact(anonymous_id) AS players FROM raw_events WHERE event = 'level_fail' AND type = 'track' AND JSONHas(context,'app') AND channel != 'server' AND anonymous_id != '' AND received_at >= toDateTime({{date_from}}) AND received_at < toDateTime({{date_to}}) + INTERVAL 1 DAY AND JSONExtractString(context,'device') != 'bot' GROUP BY level, wave ORDER BY fails DESC LIMIT 50

What do public numbers show for tower defense games?

Kingdom Rush shows the usual shape of a campaign game: most players earn the first stars, about half finish the campaign, and the hard mode is for a small group.

These are shares of players over all the years since release.

Share of players with each achievement on Steam, read on 24 November 2026.
GameAchievementWhat it needsShare of players
Kingdom RushFirst BloodKill one enemy94.9%
Kingdom RushStarryEarn 15 stars73.3%
Kingdom RushGreat DefenderComplete the campaign52.2%
Kingdom RushSuperstarEarn 45 stars37.9%
Kingdom RushSupreme DefenderComplete the campaign in Veteran mode12.7%

Steam shows, for each achievement, the share of the game's players who have it. The shares count every year since release, so they are a public outside view, not a target.

1,418 games released on Steam from 2022 to 2025 have Tower Defense in their top 7 tags. 20% of them had 50 or more reviews on 18 November 2026, and the median game had 0. The median price was $4.99. See the Tower Defense benchmarks.

How do I send the tower defense events?

Use the Unity, Godot, or Unreal SDK in the game, the web SDK in a browser game, and the HTTP events endpoint for any other engine. All of them use the publishable key, which is safe to ship in a build. The SDKs are available on request during early access; the web SDK is public.

Unity (C#)

// Unity 2021.3 or later. Add the package with Window > Package Manager > Add package from tarball.
using System.Collections.Generic;
using UnityEngine;
using ManalensSdk;

public class AnalyticsBootstrap : MonoBehaviour
{
    void Awake()
    {
        // Sends session_start and game_open. Editor runs send build "dev", so you can filter them out.
        Manalens.Init(new ManalensOptions
        {
            PublishableKey = "YOUR_PUBLISHABLE_KEY",
            Endpoint = "https://events.manalens.dev",
            Build = Application.isEditor ? "dev" : "571",
            Storefront = "steam",
        });
    }
}

// The tower defense events. Call each one where the moment happens in your game code.
public static class GenreEvents
{
    public static void Examples()
    {
        Manalens.Track("level_start", new Dictionary<string, object> { ["level"] = 7, ["attempt"] = 1, ["difficulty"] = "normal" });
        Manalens.Track("wave_end", new Dictionary<string, object> { ["level"] = 7, ["wave"] = 9, ["lives_left"] = 16, ["leaked"] = 2, ["gold"] = 340 });
        Manalens.Track("tower_built", new Dictionary<string, object> { ["level"] = 7, ["wave"] = 3, ["tower"] = "archer", ["tier"] = 2 });
        Manalens.Track("early_wave_called", new Dictionary<string, object> { ["level"] = 7, ["wave"] = 5 });
        Manalens.Track("level_complete", new Dictionary<string, object> { ["level"] = 7, ["attempt"] = 1, ["score"] = 3, ["stars"] = 3, ["lives_left"] = 18 });
        Manalens.Track("level_fail", new Dictionary<string, object> { ["level"] = 7, ["attempt"] = 2, ["score"] = 0, ["wave"] = 11 });
    }
}

Godot 4 (GDScript)

# Godot 4. Copy addons/manalens into your project and enable the plugin.
func _ready() -> void:
    # Sends session_start and game_open. Editor runs send build "dev", so you can filter them out.
    Manalens.init({
        "publishable_key": "YOUR_PUBLISHABLE_KEY",
        "endpoint": "https://events.manalens.dev",
        "app_version": "1.4.0",
        "build": "dev" if OS.has_feature("editor") else "571",
        "storefront": "steam",
    })

# The tower defense events. Call each one where the moment happens in your game code.
func _track_examples() -> void:
    Manalens.track("level_start", {"level": 7, "attempt": 1, "difficulty": "normal"})
    Manalens.track("wave_end", {"level": 7, "wave": 9, "lives_left": 16, "leaked": 2, "gold": 340})
    Manalens.track("tower_built", {"level": 7, "wave": 3, "tower": "archer", "tier": 2})
    Manalens.track("early_wave_called", {"level": 7, "wave": 5})
    Manalens.track("level_complete", {"level": 7, "attempt": 1, "score": 3, "stars": 3, "lives_left": 18})
    Manalens.track("level_fail", {"level": 7, "attempt": 2, "score": 0, "wave": 11})

Web or HTML5 (web SDK)

import { createAnalytics } from '@manalens/web';

// A browser game on your project domain or an allowed origin (*.itch.zone by default).
const analytics = createAnalytics({
  publishableKey: 'YOUR_PUBLISHABLE_KEY',
  endpoint: 'https://events.manalens.dev',
  app: { platform: 'web', storefront: 'other', app_version: '1.4.0', build: '571', engine: 'other' },
});

// The web SDK does not send game_open, session_start or session_end for you.
// Send them as in the docs (Browser and Electron games), then the tower defense events:
analytics.track('level_start', { level: 7, attempt: 1, difficulty: 'normal' });
analytics.track('wave_end', { level: 7, wave: 9, lives_left: 16, leaked: 2, gold: 340 });
analytics.track('tower_built', { level: 7, wave: 3, tower: 'archer', tier: 2 });
analytics.track('early_wave_called', { level: 7, wave: 5 });
analytics.track('level_complete', { level: 7, attempt: 1, score: 3, stars: 3, lives_left: 18 });
analytics.track('level_fail', { level: 7, attempt: 2, score: 0, wave: 11 });

Any other engine (HTTP)

# Any other engine: POST app events with the publishable key.
# Make a new session_id at game start, after 30 minutes without events, and at 24 hours.
curl -sS https://events.manalens.dev/v0/events \
  -H 'x-publishable-key: YOUR_PUBLISHABLE_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "events": [{
      "type": "track",
      "event": "wave_end",
      "channel": "app",
      "version": "0.1.0",
      "message_id": "6a0f8e9c-2c36-4c55-9a43-6a5d0f3c2b11",
      "anonymous_id": "3f0c5c1e-8a8e-4c1b-9d7e-2b1f4e6a9c10",
      "session_id": "1762689600000",
      "original_timestamp": "2026-11-09T10:00:00.000Z",
      "context": {
        "app": { "platform": "windows", "storefront": "steam", "app_version": "1.4.0", "build": "571", "engine": "other" },
        "locale": "en"
      },
      "properties": {"level":7,"wave":9,"lives_left":16,"leaked":2,"gold":340}
    }]
  }'
# {"accepted":1,"rejected":0,"errors":[]}

Where can I download the plan?

Download the plan as a CSV with one row per property and six columns: event, property, type, example, when and sent_by. It has the 6 core events and the 6 tower defense events, in the format of the Game tracking plan generator.

What should I leave out?

  • One event per enemy killed. Waves and leaks are enough.
  • Tower positions as coordinates, unless you balance maps; a slot id is shorter.
  • Ability uses every few seconds. Count them in wave_end if you need them.

Frequently asked questions

Why track waves and not only levels?

Because the wave shows where a level turns. level_fail with the wave number tells you where attempts end, and wave_end with leaked enemies shows the waves that start to slip one or two waves earlier. Fix the spike there, not at the end of the level.

Should a tower defense game send every tower built?

Yes. A level has a few dozen builds and upgrades at most, so the volume is small, and the tower mix is the best view of strategy. Send tower_built with the tower, the tier, the level and the wave. A tower nobody builds is a design problem, not a balance number.

How many Kingdom Rush players completed the campaign?

On Steam, read on 24 November 2026, 52.2% of Kingdom Rush players had Great Defender, for completing the campaign, and 12.7% had completed it in Veteran mode. 73.3% had earned 15 stars. These are shares of all its players since the game's release on Steam.

What does an early wave call tell me?

A player who calls the next wave early has more defense than the wave needs. Send early_wave_called with the level and wave. Many early calls in one level mean it is easy for experienced players; few calls and many fails mean the level asks too much too soon.

Sources

Last reviewed . Achievement shares change as more people play, so read them again on Steam before you quote them.