From expo-rn-plugin
Load analytics standards for this React Native / Expo project. Covers event naming, user identification, screen tracking, and privacy rules. Default provider is Firebase Analytics; PostHog and Amplitude are supported alternatives.
How this skill is triggered — by the user, by Claude, or both
Slash command
/expo-rn-plugin:analyticsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Apply the following analytics standards to all code in this project.
Apply the following analytics standards to all code in this project.
Default: Firebase Analytics (@react-native-firebase/analytics) — already in the Firebase MCP stack.
Alternatives:
| Provider | Package | When to prefer |
|---|---|---|
| Firebase Analytics | @react-native-firebase/analytics | Default — integrates with existing Firebase setup |
| PostHog | posthog-react-native | Product analytics, feature flags, session replay |
| Amplitude | @amplitude/analytics-react-native | Enterprise, cohort analysis, behavioral funnels |
Never call the provider SDK directly in components. Always go through a central src/services/analytics/index.ts using the Firebase v9 modular API:
// src/services/analytics/index.ts
import { getApp } from '@react-native-firebase/app';
import {
getAnalytics,
logEvent,
setUserId,
logScreenView,
} from '@react-native-firebase/analytics';
const getA = () => getAnalytics(getApp());
export const Analytics = {
identify: (userId: string) => setUserId(getA(), userId),
reset: () => setUserId(getA(), null),
screen: (name: string) => logScreenView(getA(), { screen_name: name, screen_class: name }),
track: (event: string, params?: Record<string, string | number | boolean>) =>
logEvent(getA(), event, params),
};
This lets you swap providers without touching call sites.
snake_case for all event names: item_purchased, form_submitted, onboarding_completedauth_login_success, payment_sheet_openedprofile_updated, push_enabledWire to the Expo Router navigation state — do not call Analytics.screen() manually in each screen. Create an AnalyticsProvider in app/_layout.tsx and wrap <RootLayoutNav /> with it:
// app/_layout.tsx
import { usePathname } from 'expo-router';
import { useEffect } from 'react';
import { Analytics } from '@services/analytics';
function AnalyticsProvider({ children }: { children: React.ReactNode }) {
const pathname = usePathname();
useEffect(() => { Analytics.screen(pathname); }, [pathname]);
return <>{children}</>;
}
// Inside RootLayout:
<AnalyticsProvider>
<RootLayoutNav />
</AnalyticsProvider>
// After successful sign-in
Analytics.identify(user.id);
// On sign-out
Analytics.reset();
Never identify before auth completes. Clear on sign-out.
identify() must be your internal opaque ID (UUID) — not email or phoneIf the project uses PostHog or Amplitude instead of Firebase, ask for the relevant implementation pattern and it will be provided on demand.
npx claudepluginhub anicca-labs/claude --plugin expo-rn-pluginGuides reception of code review feedback: verify before implementing, avoid performative agreement, push back with technical reasoning when needed.
Design banners for social media, ads, website heroes, and print with multiple art direction options and AI-generated visuals.