RORK LABJP
PLAY — Google Play's target API level 36 requirement took effect yesterday, August 31. From today, new apps and updates must target Android 16VISIBILITY — Apps still on API 35 stay listed but disappear for users on newer Android versions. No error is raised; new installs simply fade, which makes the change easy to missEXTENSION — If you missed the deadline, an extension through November 1, 2026 can be requested in Play Console — best filed alongside a concrete migration planAPPLE — On the Apple side, the event lands September 9 and iOS 27 is reported to ship September 14. Testing generated apps on iOS 27 hardware before release week is time well spentEXPO — Expo released expo-paste-input on August 28, a native module that brings image, GIF, and sticker paste to React Native TextInputEAS — EAS Observe reached general availability on August 20, putting crash and performance monitoring on the same EAS platform as builds and updatesPLAY — Google Play's target API level 36 requirement took effect yesterday, August 31. From today, new apps and updates must target Android 16VISIBILITY — Apps still on API 35 stay listed but disappear for users on newer Android versions. No error is raised; new installs simply fade, which makes the change easy to missEXTENSION — If you missed the deadline, an extension through November 1, 2026 can be requested in Play Console — best filed alongside a concrete migration planAPPLE — On the Apple side, the event lands September 9 and iOS 27 is reported to ship September 14. Testing generated apps on iOS 27 hardware before release week is time well spentEXPO — Expo released expo-paste-input on August 28, a native module that brings image, GIF, and sticker paste to React Native TextInputEAS — EAS Observe reached general availability on August 20, putting crash and performance monitoring on the same EAS platform as builds and updates
Articles/Dev Tools
Dev Tools/2026-04-04Intermediate

Rork × PostHog — Seeing What Users Actually Do Inside Your App

Learn how to integrate PostHog product analytics into your Rork app to understand user behavior. Step-by-step guide covering event tracking, funnels, feature flags, and user identification.

PostHog3product analyticsuser behaviorExpo193React Native234event trackingFunnel-Analysis

Why Your Rork App Needs Product Analytics

After shipping your app, it's natural to wonder: "Where are users dropping off?" or "Is anyone actually using that new feature?" App Store Connect gives you download numbers and revenue figures, but it won't tell you what users are doing inside your app.

That's the gap product analytics fills. PostHog is open source, drops into a Rork (React Native / Expo) project without much ceremony, and once events start flowing you get to watch a funnel break at a specific step instead of guessing which one. Feature flags ride along with it, so a risky screen can reach five percent of users before it reaches everyone.

What you'll learn:

  • What makes PostHog a strong choice for indie app developers
  • Installing and configuring the PostHog SDK in a Rork project
  • Tracking custom events and identifying users
  • Building funnels to find where users drop off
  • Using feature flags to release new features safely

What Is PostHog?

PostHog is an open-source product analytics platform that bundles everything a product team needs into a single tool. Unlike Mixpanel or Amplitude (which charge per event and lock features behind paid tiers), PostHog offers a generous free cloud tier and an optional self-hosted deployment.

Key capabilities include:

  • Event Analytics: Track any user action and visualize it with charts, graphs, and trend views
  • Funnel Analysis: Measure completion rates across multi-step flows like registration, onboarding, and checkout
  • Session Replay: Watch recordings of real user sessions to discover friction points (mobile support varies by platform)
  • Feature Flags: Ship features to specific user groups without a code deployment
  • A/B Testing: Compare variants and make data-driven decisions

The free cloud plan covers up to 1 million events per month — more than enough for most indie apps at launch. If data sovereignty matters to you, the self-hosted Docker option lets you keep everything on your own infrastructure.


Step 1: Create a PostHog Account and Get Your API Key

Head to PostHog Cloud and create a free account. After signing in, create a new project and note your Project API Key (it starts with phc_). You'll need this in the next step.

You can always find your API key under Settings → Project → Project API Key in the PostHog dashboard.


Step 2: Install the SDK

Inside your Rork project directory, run:

# Install the PostHog React Native SDK
npm install posthog-react-native
 
# If you're using Expo, install the required native modules
npx expo install expo-file-system expo-application expo-device expo-localization

Next, wrap your app with the PostHogProvider in your root layout file:

// app/_layout.tsx (Expo Router)
import { PostHogProvider } from 'posthog-react-native';
 
export default function RootLayout() {
  return (
    <PostHogProvider
      apiKey="YOUR_POSTHOG_API_KEY"  // Your phc_ project key
      options={{
        host: 'https://us.i.posthog.com',  // Use https://eu.i.posthog.com for EU
      }}
    >
      <Stack />
    </PostHogProvider>
  );
}

Tip: Store your API key in an .env file as EXPO_PUBLIC_POSTHOG_KEY rather than hardcoding it. PostHog public API keys (the phc_ ones) are client-side keys by design, but using environment variables keeps your codebase cleaner.


Step 3: Track Your First Events

With the provider in place, you can use the usePostHog hook in any component to send events to your dashboard.

// components/SubscribeButton.tsx
import { TouchableOpacity, Text } from 'react-native';
import { usePostHog } from 'posthog-react-native';
 
export function SubscribeButton() {
  const posthog = usePostHog();
 
  const handlePress = () => {
    // Capture an event with optional properties
    posthog.capture('subscribe_button_tapped', {
      screen: 'HomeScreen',
      plan: 'pro',
    });
 
    // Proceed with actual purchase logic
  };
 
  return (
    <TouchableOpacity onPress={handlePress}>
      <Text>Upgrade to Pro</Text>
    </TouchableOpacity>
  );
}

Keep event names in snake_case (e.g., subscribe_button_tapped) for consistency. You can attach any properties that will help you slice and filter data later — screen names, user plan types, session metadata, and so on.


Step 4: Identify Users After Sign-In

By default, events are recorded for anonymous users. Once a user signs in, call identify to link all previous and future events to their account.

// hooks/useAuth.ts
import { usePostHog } from 'posthog-react-native';
 
export function useAuth() {
  const posthog = usePostHog();
 
  const signIn = async (userId: string, email: string) => {
    // Your existing sign-in logic (Firebase Auth, Supabase, etc.)
    await performSignIn(userId);
 
    // Attach user info to PostHog
    posthog.identify(userId, {
      email: email,
      plan: 'free',
      created_at: new Date().toISOString(),
    });
  };
 
  const signOut = async () => {
    await performSignOut();
 
    // Reset the session on sign-out
    posthog.reset();
  };
 
  return { signIn, signOut };
}

After calling identify, PostHog merges the anonymous pre-login events with the identified user's profile. This gives you a complete, continuous view of each user's journey from first open through conversion.


Step 5: Build a Funnel to Find Drop-Off Points

Funnels are one of the most actionable reports in any analytics tool. They show you exactly which step in a multi-step flow causes the most drop-off.

To build a funnel, simply fire an event at each step:

// screens/Onboarding.tsx
const handleStep1Complete = () => {
  posthog.capture('onboarding_step1_completed'); // Profile setup done
  setStep(2);
};
 
const handleStep2Complete = () => {
  posthog.capture('onboarding_step2_completed'); // Notification preferences set
  setStep(3);
};
 
const handleOnboardingComplete = () => {
  posthog.capture('onboarding_completed');       // Full flow complete
  router.push('/home');
};

In the PostHog dashboard, navigate to Funnels, add these events in order, and PostHog will calculate the conversion rate at each step automatically. If you're seeing 80% of users complete Step 1 but only 40% reach Step 2, you know exactly where to focus your UX improvements.

For a deeper dive into improving user experience metrics hand-in-hand with analytics, check out the Rork App Performance Optimization Complete Guide — performance and user behavior are closely linked.


Step 6: Roll Out Features Safely with Feature Flags

Feature flags let you expose new functionality to a subset of your users without shipping a new app version. This is invaluable for testing risky UI changes or gradually rolling out a feature to avoid support overload.

// components/NewFeatureBanner.tsx
import { useFeatureFlagEnabled } from 'posthog-react-native';
 
export function NewFeatureBanner() {
  // Create a flag called 'new-dashboard-ui' in the PostHog dashboard
  const isEnabled = useFeatureFlagEnabled('new-dashboard-ui');
 
  if (!isEnabled) return null;
 
  return (
    <View>
      <Text>✨ Try our redesigned dashboard!</Text>
    </View>
  );
}

From the PostHog dashboard, you can configure the flag to roll out to 10% of users, target users with a specific property (e.g., plan = 'pro'), or enable it for your own account only for testing. When you're confident the new experience works well, simply flip the flag to 100%.


Looking back

Adding PostHog to your Rork app gives you the visibility to make informed product decisions rather than relying on guesswork. Here's a quick recap of what we covered:

  • PostHog is a free, open-source product analytics platform with event tracking, funnels, feature flags, and A/B testing all in one place
  • Installing posthog-react-native and wrapping your app with PostHogProvider takes just a few minutes
  • Use capture to record events and identify to tie them to specific users after sign-in
  • Funnel analysis helps you pinpoint exactly where users drop off in critical flows
  • Feature flags let you ship new functionality safely and gradually

Moving from gut-feel decisions to data-driven ones is one of the highest-leverage shifts an indie developer can make. Even a simple funnel showing onboarding completion rates can reveal improvements that dramatically impact retention and revenue.

If you want to go deeper on monetization analytics, the Rork × RevenueCat Subscription Monetization Guide is a great next step — combining revenue data with behavioral data gives you the clearest picture of what's actually driving growth.

Share

Thank You for Reading

Rork Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $15 for lifetime access
View Membership →

If you found this article helpful, a small tip ($1.50) would mean a lot to us. Your support helps keep this site ad-free and covers server and hosting costs.

Related Articles

Dev Tools2026-09-01
Adding image paste with expo-paste-input, and moving the disappearing file:// URIs out of cache
How to let users paste images and GIFs into a chat input with expo-paste-input. The URIs that onPaste hands you are temporary files that can vanish before the user hits send. Here is the relocation code and the order I verify it on real devices.
Dev Tools2026-08-31
Three Minutes After the Screen Locked, My expo-audio Ambient Sound Went Silent
Why expo-audio stops playing when the screen locks, diagnosed as three separate layers: build config, audio session, and lock screen integration. The three-minute stop on Android is documented behavior.
Dev Tools2026-08-24
I Moved My Dark Mode Checks Into DevTools, and Only Four Places Still Need a Real Device
Expo SDK 57 added light and dark emulation to React Native DevTools, which ended my trips to the Settings app. What it swaps is the value JavaScript reports, so a few places still need a real toggle. Here is how to find that boundary in your own project.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →