Setting Up Analytics That Actually Help
What to track, what to ignore, and how to use data to improve your app.
GUIDE BODY
The Analytics Problem
Most developers fall into one of two traps. They either track nothing and make decisions based on gut feeling, or they track everything and drown in data they never look at. Both approaches waste your time.
Good analytics means tracking the right things, reviewing them regularly, and making decisions based on what you find. This guide covers exactly what to track, how to set it up, and how to turn data into action.
Choosing an Analytics Tool
For mobile apps, the main options are:
PostHog
- Open source, self-hostable, or cloud-hosted
- Event tracking, session replays, feature flags, A/B testing
- Generous free tier (1 million events/month)
- Good React Native SDK
- Best for: indie developers who want one tool that does everything
Mixpanel
- Event-based analytics with powerful segmentation
- Funnel analysis and retention reports
- Free up to 20 million events/month
- Best for: apps that need detailed funnel analysis
Amplitude
- Similar to Mixpanel with strong behavioral analytics
- Free tier up to 10 million events/month
- Best for: product teams focused on user behavior
Firebase Analytics (Google Analytics for Firebase)
- Free, no event limits
- Integrated with other Firebase services
- Limited customization compared to Mixpanel/Amplitude
- Best for: apps already using Firebase
Our Recommendation
For most indie developers, PostHog is the best starting point. One tool for events, funnels, retention, and feature flags. The free tier covers most indie apps indefinitely.
Setting Up PostHog in React Native
npm install posthog-react-native
// lib/posthog.ts
import PostHog from 'posthog-react-native';
const apiKey = process.env.EXPO_PUBLIC_POSTHOG_API_KEY;
export const posthog = apiKey
? new PostHog(apiKey, {
host: 'https://us.i.posthog.com',
})
: null;
export function trackEvent(
name: string,
properties?: Record<string, any>
) {
if (!posthog) return;
posthog.capture(name, properties);
}
export function identifyUser(
userId: string,
traits?: Record<string, any>
) {
if (!posthog) return;
posthog.identify(userId, traits);
}
Call identifyUser when the user logs in. Call trackEvent when they do something meaningful.
What to Track: The Essential Events
You do not need to track every tap. Track events that answer these five questions:
1. Are Users Signing Up?
// Track when signup completes
trackEvent('signup_completed', {
method: 'email', // or 'google', 'apple'
});
// Track when onboarding completes
trackEvent('onboarding_completed', {
steps_completed: 4,
time_spent_seconds: 45,
});
2. Are Users Reaching the Core Value?
Every app has a moment where the user first gets value. For a workout app, it is completing a workout. For a budget app, it is seeing their spending breakdown. Track this moment explicitly.
// The "aha moment" for a workout app
trackEvent('first_workout_completed', {
exercise_count: 5,
duration_minutes: 22,
});
// For a budget app
trackEvent('first_budget_created', {
categories: 8,
monthly_amount: 3500,
});
3. Are Users Coming Back?
Track session starts with context:
trackEvent('app_opened', {
days_since_last_open: 2,
session_count: 15,
});
Your analytics tool calculates retention automatically, but tracking session context helps you understand patterns.
4. Are Users Paying?
trackEvent('paywall_viewed', {
source: 'feature_limit', // or 'settings', 'onboarding'
});
trackEvent('subscription_started', {
plan: 'annual',
price: 59.99,
trial: true,
});
trackEvent('subscription_cancelled', {
plan: 'monthly',
reason: 'too_expensive', // if you ask
tenure_months: 3,
});
5. Are Users Having Problems?
trackEvent('error_occurred', {
screen: 'dashboard',
error_type: 'network',
message: 'Failed to load data',
});
trackEvent('feature_failed', {
feature: 'export_pdf',
reason: 'file_too_large',
});
What NOT to Track
Every Screen View
Screen views create noise. If you need to know which screens are popular, track navigation events selectively for the screens that matter, not every single transition.
Every Button Tap
Tracking "user tapped button X" for every button in your app generates millions of events and tells you very little. Track actions that represent meaningful user intent, not UI interactions.
Personally Identifiable Information
Never track names, email addresses, phone numbers, or other PII in analytics events. Besides being a privacy concern, it often violates GDPR and app store policies.
Vanity Metrics
Total downloads, total signups, and total page views look impressive but tell you nothing about whether your app is healthy. Focus on active users, retention, and revenue.
The Metrics That Matter
Retention Rate
The single most important metric. If users do not come back, nothing else matters.
- Day 1 retention: What percentage of users open the app the day after installing? Benchmark: 25-40% is average, 40%+ is good.
- Day 7 retention: What percentage are still active after a week? Benchmark: 10-20% is average, 20%+ is good.
- Day 30 retention: What percentage are still active after a month? Benchmark: 5-10% is average, 10%+ is good.
If your day 1 retention is below 20%, your onboarding or first experience needs work.
Activation Rate
What percentage of new users reach the "aha moment"? If only 30% of signups complete their first core action, you need to remove friction from the path between signup and value.
Conversion Rate
What percentage of free users become paying users? Track this as a funnel:
Download → Signup → Activation → Paywall View → Trial Start → Paid Conversion
Each step reveals where users drop off.
Revenue Metrics
- MRR (Monthly Recurring Revenue): Total subscription revenue per month
- ARPU (Average Revenue Per User): MRR divided by active users
- LTV (Lifetime Value): Average total revenue per user over their lifetime
- Churn rate: Percentage of subscribers who cancel per month
The One Metric That Matters (OMTM)
At any given time, focus on one primary metric. Early stage: focus on retention. Growth stage: focus on activation rate. Monetization stage: focus on conversion rate. Trying to optimize everything at once means optimizing nothing.
Building Dashboards
Create a simple dashboard you review weekly:
Weekly Review Dashboard
This Week:
- New signups: ___
- Day 1 retention: ___%
- Weekly active users: ___
- Paywall views: ___
- New subscribers: ___
- MRR: $___
- Top error: ___
Trends (vs. last week):
- Signups: ↑/↓ __%
- Retention: ↑/↓ __%
- Revenue: ↑/↓ __%
Setting Up Alerts
Configure alerts for critical events:
- Crash rate exceeds 1%
- Day 1 retention drops below 25%
- Error rate on key features spikes
- Revenue drops more than 20% week-over-week
You should not need to check your dashboard to know something is wrong. Alerts bring problems to you.
Funnels: Finding Where Users Drop Off
A funnel shows the percentage of users who complete each step in a sequence. Build funnels for your most critical flows:
Onboarding Funnel
App Install → Open App → Start Onboarding → Complete Step 1 →
Complete Step 2 → Complete Step 3 → Create Account → Enter App
If 80% of users complete step 1 but only 30% complete step 2, step 2 is your bottleneck. Investigate: Is it confusing? Too long? Asking for too much information?
Conversion Funnel
Free User → View Paywall → Start Trial → Use Premium Feature →
Trial Expires → Convert to Paid
Each drop-off point tells you something:
- Low paywall views: Users do not know premium exists, or the free tier is too generous
- Low trial starts: The paywall is not compelling, or the price is too high
- Low conversion after trial: The premium features are not valuable enough
Cohort Analysis
Cohort analysis groups users by when they signed up and tracks their behavior over time. This reveals whether your product is improving.
If users who signed up in March have better retention than users who signed up in January, your product changes are working. If retention is declining across cohorts, something is getting worse.
Most analytics tools provide cohort analysis out of the box. Review monthly.
A/B Testing
Once you have baseline metrics, test changes:
- Onboarding flow: Test a 3-step vs. 5-step onboarding
- Paywall design: Test different layouts, copy, and pricing presentations
- Feature placement: Test moving a key feature to the home screen
A/B Testing Rules
- Test one change at a time
- Run tests for at least 1-2 weeks
- Need at least 100-200 users per variant for meaningful results
- Define your success metric before starting the test
- Do not peek at results early (let the test complete)
PostHog and most analytics tools include built-in A/B testing with feature flags.
Privacy and Compliance
GDPR
If you have users in Europe:
- Disclose what you track in your privacy policy
- Allow users to opt out of analytics
- Do not track PII in events
- Respond to data deletion requests
App Tracking Transparency (iOS)
Since iOS 14.5, you must ask permission before tracking users across apps and websites. Analytics within your own app do not require ATT permission, but ad tracking does.
Best Practices
- Use anonymous IDs by default
- Only identify users after they create an account
- Provide a "Do not track" option in settings
- Document your data practices in your privacy policy
The Analytics Workflow
- Week 1: Set up analytics, define core events, build your first dashboard
- Weekly: Review dashboard, check retention, note anomalies
- Monthly: Run cohort analysis, review funnels, identify optimization opportunities
- Quarterly: Review overall trends, set new metric targets, adjust tracking
Analytics is not a one-time setup. It is a habit. The teams that review their data consistently build better products than the teams that install analytics and forget about it.
Getting Started Today
Start with these five events:
signup_completedcore_action_completed(your app's key value moment)paywall_viewedsubscription_startederror_occurred
These five events answer the fundamental questions: Are people signing up? Getting value? Considering paying? Actually paying? Having problems? Everything else can wait until you have mastered these basics.