umami-analytics

Implements SSR-safe Umami tracking events and session identification in Astro runtime code.

Updated Sep 6, 2026
One-click install
npx skills add https://github.com/malikkotb/shellpluscore --skill umami-analytics-malikkotb
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: umami-analytics
Source: https://github.com/malikkotb/shellpluscore/tree/main/.agents/skills/umami-analytics
Command: npx skills add https://github.com/malikkotb/shellpluscore --skill umami-analytics-malikkotb

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Adding analytics instrumentation to an Astro SSR application often leads to unsafe direct window.umami access, inconsistent event naming, and oversized payloads. This Skill standardizes how Umami tracking events and session identification are implemented so instrumentation stays typed, SSR-safe, and consistent. ## Core Features & Use Cases - Typed tracking helpers: Uses track and identify from ~/features/umami/tracking with typed overloads for page views, named events, and event data. - SSR-safe instrumentation: Helpers no-op when window.umami is unavailable, so tracking code is safe in server-rendered Astro code. - Payload guardrails: Enforces Umami data constraints (string/number/boolean values, small objects) and consistent kebab-case or snake_case event naming. - Use Case: When adding a "contact form submitted" event to an Astro page, apply this Skill to wire the event through the existing typed helpers instead of touching window.umami directly, then validate with npm run check. ## Quick Start Add a typed Umami tracking event for the contact form submission using the helpers in src/features/umami/tracking.

Frequently Asked Questions about umami-analytics

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add Umami event tracking in an Astro project?

Use the track helper from src/features/umami/tracking: call track() for page views, track("event-name") for named events, or track("event-name", data) for events with typed data. Avoid accessing window.umami directly in feature code.

How do I identify users or sessions with Umami?

Call identify(uniqueId) or identify(uniqueId, data) from the tracking helpers when session identification is intentional and privacy-safe. Identification data values must be strings, numbers, or booleans.

Is Umami tracking safe to call during Astro server-side rendering?

Yes, the helpers in src/features/umami/tracking are SSR-safe and no-op when window.umami is unavailable. This means tracking calls will not crash server-rendered pages or run before the Umami script loads.

What data types are allowed in Umami event payloads?

Event and session data values must be string, number, or boolean. Keep strings short and objects small to stay within Umami limits documented in src/features/umami/types.ts.

Why should I avoid direct window.umami access in feature code?

Direct window.umami access bypasses SSR safety and typed call signatures, risking runtime errors when the script is absent. The shared helpers centralize guardrails, naming consistency, and no-op behavior.