Token导航 LogoToken导航TokenDH.com
开发执行命令github未标认证来源可访问许可证需确认审计通过

firebase-analyticsFirebase 分析

Agent Skill

用于辅助数据整理、表格处理、CSV/Excel 分析、指标计算和图表准备。它适合让 Agent 清洗字段、汇总数据、发现异常、生成统计口径或把分析结果转成可读说明。使用时需要确认数据来源、字段含义和时间范围,避免把样本数据当全量事实;涉及敏感数据、导出文件或批量写回时,应先确认权限和脱敏边界。

总安装

291

周安装

12

GitHub Stars

537

下载量

95
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:firebase-analytics(Firebase 分析)
来源仓库:https://github.com/evanca/flutter-ai-rules
仓库路径:skills/firebase-analytics
安装命令:
npx skills add https://github.com/evanca/flutter-ai-rules --skill firebase-analytics
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/evanca/flutter-ai-rules --skill firebase-analytics

简介

用于辅助数据整理、表格处理、CSV/Excel 分析、指标计算和图表准备。

  • 适合让 Agent 清洗字段、汇总数据、发现异常、生成统计口径或把分析结果转成可读说明。
  • 使用时需要确认数据来源、字段含义和时间范围,避免把样本数据当全量事实。
  • 涉及敏感数据、导出文件或批量写回时,应先确认权限和脱敏边界。
  • firebase-analytics 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Firebase Analytics Skill

This skill defines how to correctly implement Firebase Analytics in Flutter applications, covering setup, event logging, user properties, and data collection best practices.

When to Use

Use this skill when:

  • Setting up and configuring Firebase Analytics in a Flutter project.
  • Logging predefined or custom analytics events.
  • Setting user properties or default event parameters.
  • Implementing screen view tracking with GoRouter or Navigator observers.
  • Building conversion funnels or tracking user flows.

1. Setup and Configuration

flutter pub add firebase_analytics
flutter run
import 'package:firebase_analytics/firebase_analytics.dart';

// After Firebase.initializeApp():
FirebaseAnalytics analytics = FirebaseAnalytics.instance;
  • Initialize Firebase before using any Firebase Analytics features.
  • Analytics automatically logs some events and user properties — no additional code needed for those.
  • On iOS, if your app does not use the IDFA (Advertising Identifier), use FirebaseAnalyticsWithoutAdIdSupport instead of the default iOS dependency to avoid App Store review questions about advertising identifiers:

- Swift Package Manager: set FIREBASE_ANALYTICS_WITHOUT_ADID=true when building (FIREBASE_ANALYTICS_WITHOUT_ADID=true flutter build ios). - CocoaPods: add both pod 'FirebaseAnalytics',:modular_headers => true and pod 'FirebaseAnalyticsWithoutAdIdSupport',:modular_headers => true to your Podfile.

Add Navigator Observer for Automatic Screen Tracking

MaterialApp(
  navigatorObservers: [
    FirebaseAnalyticsObserver(analytics: FirebaseAnalytics.instance),
  ],
);

For GoRouter, log screen views manually on route changes:

GoRouter(
  observers: [FirebaseAnalyticsObserver(analytics: FirebaseAnalytics.instance)],
);

Verification Checklist

  1. Confirm Firebase.initializeApp() completes before accessing FirebaseAnalytics.instance.
  2. Run the app and check the Firebase DebugView console for incoming events.
  3. Confirm automatic events (first_open, session_start) appear without extra code.

2. Event Logging

Use predefined event methods when possible for maximum detail in reports and access to future Google Analytics features:

await FirebaseAnalytics.instance.logSelectContent(
  contentType: "image",
  itemId: itemId,
);

Use the general logEvent() method for both predefined and custom events:

await FirebaseAnalytics.instance.logEvent(
  name: "select_content",
  parameters: {
    "content_type": "image",
    "item_id": itemId,
  },
);

Custom Event Example — E-commerce Add-to-Cart

Future<void> logAddToCart(String productId, String productName, double price) async {
  await FirebaseAnalytics.instance.logEvent(
    name: 'add_to_cart',
    parameters: {
      'product_id': productId,
      'product_name': productName,
      'price': price,
      'currency': 'USD',
    },
  );
}
  • Event names are case-sensitive — names differing only in case create two distinct events.
  • Up to 500 different event types with no limit on total event volume.
  • Event names must start with an alphabetic character, contain only alphanumeric characters and underscores, and be no longer than 40 characters.

3. Parameters and Properties

  • Parameter names: up to 40 characters, must start with an alphabetic character, contain only alphanumeric characters and underscores.
  • String parameter values: up to 100 characters.
  • The prefixes firebase_, google_, and ga_ are reserved — do not use them for parameter names.
  • Up to 25 custom parameters per event.
  • Register custom parameters in the Analytics console to use them as dimensions or metrics in reports.

Set default parameters for all future events (not supported on web):

await FirebaseAnalytics.instance.setDefaultEventParameters({
  'app_version': '1.2.3',
  'environment': 'production',
});

Clear a default parameter by setting it to null.


4. User Properties

await FirebaseAnalytics.instance.setUserProperty(
  name: 'favorite_food',
  value: favoriteFood,
);

Set the user ID to correlate events across devices:

await FirebaseAnalytics.instance.setUserId(id: 'user_12345');
  • Create custom definitions for user properties in the Analytics console before using them.
  • Up to 25 custom user properties per project.
  • Use user properties for audience segmentation, report filtering, or A/B test targeting.

5. Best Practices

  • Request necessary permissions before collecting user data, especially on platforms with strict privacy controls.
  • Never log sensitive or personally identifiable information in events or user properties.
  • Use consistent naming conventions (snake_case) for custom events and parameters.
  • Group related events to track user flows and conversion funnels.
  • Use DebugView in the Firebase console during development — enable it on a physical device with:

- Android: adb shell setprop debug.firebase.analytics.app <package_name> - iOS: Add -FIRDebugEnabled to scheme arguments in Xcode.

  • Test analytics implementation before deploying to production by confirming events appear in DebugView.

References

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

33.03%
按下载量换算31

Claude

31.24%
按下载量换算30

Cursor

18.33%
按下载量换算17

Gemini CLI

8.66%
按下载量换算8

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/evanca/flutter-ai-rules --skill firebase-analytics 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills