Automated summary
Implements a comprehensive analytics and heatmap tracking system for Unity games using an abstracted provider interface.
Strengths
- Abstract interface supports multiple analytics providers (Unity, Firebase, Mixpanel)
- Standardized event naming conventions (snake_case) for consistency
- Spatial heatmap recording allows visual level design analysis
- Performance optimizations like event batching to reduce battery drain
Limitations
- Requires Unity engine (version >=6.0)
- Does not include visualization or dashboard for heatmaps
- Tracking external providers' SDK dependencies may increase build size
Use this skill when you need data-driven insights into player behavior, retention, monetization, or level design flaws in a Unity game.
Do not use this skill for non-game applications or projects where simple console logging or existing built-in analytics are sufficient.
Security analysis
SafeThe skill provides code examples for implementing analytics and heatmap tracking in Unity, with no destructive or exfiltrating instructions. The allowed tools (run_command, list_dir, write_to_file) are used for legitimate development tasks and do not introduce risk.
No concerns found
How this analysis is madeExamples
Implement analytics tracking for level completion events including level ID, score, and time played.Set up a heatmap system that records player death positions to help balance level difficulty.Initialize Unity Analytics as the main provider with fallback to local logging.name: analytics-heatmaps description: "Implementation of comprehensive analytics tracking and heatmap data collection for player behavior analysis." version: 2.0.0 tags: ["analytics", "tracking", "heatmaps", "metrics", "telemetry"] argument-hint: "event='LevelComplete' params='time,score' OR heatmap='death_pos'" disable-model-invocation: false user-invocable: true allowed-tools:
- run_command
- list_dir
- write_to_file requirements: unity_version: ">=6.0" render_pipeline: "Any" dependencies: [] context_discovery: check_unity_version: true check_render_pipeline: false scan_manifest_for: [] performance_budget: gc_alloc_per_frame: "N/A - async or editor-only" max_update_cost: "N/A" tdd_first: false
Analytics & Heatmaps
Overview
System for tracking player behavior events and spatial data (heatmaps). Supports multiple providers (Unity Analytics, Firebase, Mixpanel) via an interface abstraction.
When to Use
- Use for measuring retention (Day 1, Day 7)
- Use for balancing game difficulty (win/loss rates)
- Use for finding level design flaws (spatial heatmaps)
- Use for tracking monetization conversion
- Use for debugging user flows (funnels)
Architecture
┌─────────────────────────────────────────────────────────────┐
│ ANALYTICS PIPELINE │
├─────────────────────────────────────────────────────────────┤
│ │
│ GAMEPLAY CODE │
│ ┌──────────────────────┐ │
│ │ "LevelComplete" │ │
│ │ Params: {Score: 100} │ │
│ └──────────┬───────────┘ │
│ │ │
│ ▼ │
│ ANALYTICS MANAGER (Interface) │
│ ┌──────────┬───────────┬───────────┐ │
│ │ Provider │ Provider │ Heatmap │ │
│ │ (Unity) │ (Google) │ Recorder │ │
│ └──────────┴───────────┴─────┬─────┘ │
│ │ │
│ ▼ │
│ ┌───────────┐ │
│ │ LOCAL LOG │ (Dev builds) │
│ └───────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘
tracked Event Structure
| Event Name | Parameters | Goal |
|------------|------------|------|
| game_start | version, platform | Daily Active Users (DAU) |
| level_start | level_id, difficulty | Engagement |
| level_complete | level_id, time, score | Progression |
| process_fail | level_id, reason | Churn analysis |
| iap_transaction | product_id, price | Revenue |
Best Practices
- ✅ Wrap external SDKs (don't call
Firebasedirectly) - ✅ Use standardized event naming (
noun_verborsnake_case) - ✅ Track "First Time User Experience" (FTUE) rigidly
- ✅ Record screen resolution and device specs
- ✅ Batch events to save battery
- ❌ NEVER track Personally Identifiable Information (PII) without consent
- ❌ NEVER track high-frequency events (e.g., Update loop)
- ❌ NEVER rely on client-side timestamps (use server time)
Few-Shot Examples
Example 1: Analytics Service
User: "Track level completion."
Agent:
public class AnalyticsService : MonoBehaviour
{
public void TrackLevelComplete(string levelId, int score, float duration)
{
var params = new Dictionary<string, object>
{
{ "level_id", levelId },
{ "score", score },
{ "duration_seconds", duration },
{ "user_level", _player.Level }
};
SendEvent("level_complete", params);
}
private void SendEvent(string name, Dictionary<string, object> parameters)
{
// Wrapper for SDKs
Unity.Services.Analytics.AnalyticsService.Instance.CustomData(name, parameters);
Debug.Log($"[Analytics] {name}: {JsonConvert.SerializeObject(parameters)}");
}
}
Example 2: Heatmap Recorder
User: "Record where players die."
Agent:
public class HeatmapRecorder : MonoBehaviour
{
public void RecordDeath(Vector3 position)
{
// Round to grid to save data density
int x = Mathf.RoundToInt(position.x);
int z = Mathf.RoundToInt(position.z);
var data = new Dictionary<string, object>
{
{ "pos_x", x },
{ "pos_z", z },
{ "level", SceneManager.GetActiveScene().name }
};
AnalyticsService.Instance.TrackEvent("player_death_location", data);
}
}
Example 3: Funnel Tracking
User: "Track tutorial steps."
Agent:
public void TrackTutorialStep(int stepIndex, string stepName)
{
AnalyticsService.Instance.TrackEvent("tutorial_step", new() {
{ "step_index", stepIndex },
{ "step_name", stepName },
{ "time_since_start", Time.timeSinceLevelLoad }
});
}
Related Skills
@backend-integration- Store analytics remotely@monetization-iap- Track purchases@mobile-optimization- Battery-safe tracking
From the file to a first result
The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.
View the source and supporting filesThis download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.
1. Download the file
Download SKILL.mdFrom the root of a test project, save the file as .skill-downloads/player-analytics-heatmaps-mmio70xh/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.
Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.
mkdir -p '.skill-downloads/player-analytics-heatmaps-mmio70xh' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/player-analytics-heatmaps-mmio70xh/download' --output '.skill-downloads/player-analytics-heatmaps-mmio70xh/SKILL.md.part' && mv '.skill-downloads/player-analytics-heatmaps-mmio70xh/SKILL.md.part' '.skill-downloads/player-analytics-heatmaps-mmio70xh/SKILL.md'2. Check prerequisites
Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.
No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.
The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.
3. Load the skill
After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.
Claude Code
test -f '.skill-downloads/player-analytics-heatmaps-mmio70xh/SKILL.md' && test -s '.skill-downloads/player-analytics-heatmaps-mmio70xh/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/analytics-heatmaps' && cp -R '.skill-downloads/player-analytics-heatmaps-mmio70xh' '.claude/skills/analytics-heatmaps'OpenSkills
OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.
Official OpenSkills installationopenskills install './.skill-downloads/player-analytics-heatmaps-mmio70xh'openskills read 'player-analytics-heatmaps-mmio70xh'Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.
For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.
openskills syncManual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.
4. Try a first task
Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:
Read .skill-downloads/player-analytics-heatmaps-mmio70xh/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.
React Hook Form Best Practices
Development
Master React Hook Form: avoid anti-patterns, manage subscriptions, and handle reset, dirty state, and controlled inputs correctly.
Emotion to Mantine Migration
Development
Migrate Emotion styled-components to Mantine components with style props and CSS modules. Use when converting .styled.tsx files or removing @emotion imports.
Scope Creep Detector
Development
Analyzes git diffs against a stated intent to detect scope creep, unrelated files, broad PRs, and oversized changes, then suggests keep, split, or justify actions.