Skip to content
Agentmart
Submit a tool

setup-analytics

Enable Firebase Analytics, Crashlytics, and Remote Config feature flags in the KMP app — log events, add a flag, toggle it at runtime via Remote Config, and…

Skill by KotlinFoundation

IndexedMIT★ 28
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/kotlinfoundation-setup-analytics

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Enable Firebase Analytics, Crashlytics, and Remote Config feature flags in the KMP app — log events, add a flag, toggle it at runtime via Remote Config, and verify events in DebugView. Use when the developer wants analytics, crash reporting, or remote feature flags. Firebase must already be set up (integrations phase).

Use cases: data

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 26, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/setup-analytics

What's inside

Skill name
setup-analytics
Description
Enable Firebase Analytics, Crashlytics, and Remote Config feature flags in the KMP app — log events, add a flag, toggle it at runtime via Remote Config, and verify events in DebugView. Use when the developer wants analytics, crash reporting, or remote feature flags. Firebase must already be set up (integrations phase).
License
MIT
Instructions
75 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Set up analytics, Crashlytics & feature flags

All three ride on the **same Firebase project** wired in the `integrations` phase (Analytics,
Crashlytics, and Remote Config are Firebase features — no new project). Enable each in the console,
then use the app's existing abstractions.

## 1. Enable in the Firebase Console

Open https://console.firebase.google.com/ → your project:
- **Analytics** — the Analytics dashboard (enabled with the project); confirm the Android/iOS apps
  report.
- **Crashlytics** — **Run & monitor → Crashlytics → Enable Crashlytics** (a first crash/report must
  arrive before the dashboard populates).
- **Remote Config** — **Run & monitor → Remote Config**; you'll add parameters in step 3.

## 2. Log analytics events

Events go through the `Analytics` interface — Firebase Analytics on mobile, no-op elsewhere:
`shared/src/commonMain/kotlin/com/kotlinfoundation/koko/util/analytics/Analytics.kt`.

- `analytics.logEvent(event, params)` — custom event.
- `analytics.logScreenView(screenName)` — the common screen-view event.

Define new event/param names as constants in the `Analytics` companion (e.g. `EVENT_SCREEN_VIEW`,
`EVENT_CLICKED_GENERATE`) rather than raw strings. Inject `Analytics` via Koin and log at your funnel
points (screen entry, key conversions). Analytics is gated by the `IS_ANALYTICS_ENABLED` flag in
`AppInitializer.initializeAnalytics()`.

## 3. Feature flags via Remote Config

Flags are read through `FeatureFlagManager`
(`shared/src/commonMain/kotlin/com/kotlinfoundation/koko/data/source/featureflag/FeatureFlagManager.kt`),
backed by Firebase Remote Config on Android/iOS and a no-op elsewhere. `AppInitializer` calls
`syncsFlagsAsync()` on startup; values fall back to `DEFAULT_VALUES` until fresh ones fetch.

**Add a flag** in `FeatureFlagManager`:
```kotlin
object Keys {
    const val IS_ADS_ENABLED = "is_ads_enabled"
    const val IS_ANALYTICS_ENABLED = "is_analytics_enabled"
    const val SHOW_REMOTE_PAYWALL = "show_remote_paywall"
    const val MY_NEW_FLAG = "my_new_flag" // <- add
}
val DEFAULT_VALUES: Map<String, Comparable<Nothing>> = mapOf(
    Keys.IS_ADS_ENABLED to false,
    Keys.IS_ANALYTICS_ENABLED to true,
    Keys.SHOW_REMOTE_PAYWALL to false,
    Keys.MY_NEW_FLAG to false, // <- default until Remote Config fetches
)
```

**Read it:** `featureFlagManager.getBoolean(FeatureFlagManager.Keys.MY_NEW_FLAG)` (also
`getString` / `getLong` / `getDouble`).

**Toggle it at runtime:** in the Firebase Console → **Remote Config**, **Add parameter** with the
same key string (`my_new_flag`), set the value, and **Publish changes**. The next `syncsFlagsAsync()`
(app start) picks it up — no app release needed. Publishing lets you enable/disable a feature or roll
it out to a subset of users without shipping.

## 4. Verify in DebugView

Firebase **DebugView** shows events in near-real-time from a debug-enabled device:
- Android: `adb shell setprop debug.firebase.analytics.app <applicationId>`
- Then open **Firebase Console → Analytics → DebugView** and drive the app.

Use `AppLogger`
(the facade declared in `shared/src/commonMain/kotlin/com/kotlinfoundation/koko/util/logging/Logger.kt`
alongside the `Logger` interface it fans out to, initialized in `AppInitializer`) for local
`AppLogger.d(...)` traces alongside DebugView while confirming events fire.

## Done
An event appears in DebugView and a Remote Config parameter change flips your flag on next launch.
This is the `setup-analytics` step of the `growth` phase.

From KotlinFoundation/kmp-contest-starter-kit, MIT.

More from KotlinFoundation/kmp-contest-starter-kit

Signals

Stars
28
Forks
13
Open issues
1
Last commit (this folder)
Aug 10, 2026 (2 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from KotlinFoundation

Cite this page

setup-analytics skill. Agent Mart. https://agentmart.dev/skills/kotlinfoundation-setup-analytics (last updated 2026-10-24)