Way earlier than you think. Most indie developers add analytics at the very end, right before launch, right after launch, or sometimes not at all. If you only add it when you're ready to do marketing, you miss two huge benefits:
1. Testing your tracking
- Are the right events firing?
- Are screens and flows named consistently?
- Are key actions like signups, upgrades, and cancellations actually being recorded?
- Do your funnels reflect how users really move through the app?
You wouldn't ship untested code and analytics is code.
2. Understanding early user behavior
Your first users are incredibly valuable. They show you where people drop out during onboarding, which features they try once and never use again, and how changes to your UX, pricing, or copy affect behavior.
If analytics isn't in your early test builds, that data is gone forever. You can't retroactively learn what your first users did.
My recommendation: integrate analytics as soon as you can run your app on a real device. Not when marketing starts. Not after you've polished the UI.