Document mobile session_id, user-agent, screen paths, and Android attribution (P-2199 + P-2207)#110
Conversation
Mobile SDK docs were missing three behaviors surfaced by P-2199: - session_id (previously only reset() was documented) - user_agent in the mobile context table - screens map to app://<bundleId>/<name> page URLs Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e1d39dbd2f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| Include `formo` in the dependency array. The SDK initializes asynchronously, so including it ensures the screen event fires once initialization completes. | ||
| </Note> | ||
|
|
||
| Screen views are sent as `page` events so they flow through the same analytics as web page views. The screen name becomes the page path, under a stable origin taken from your app's `bundleId`. For example, `formo.screen('Wallet')` in an app with a `bundleId` of `com.example.app` is recorded with a `page_url` of `app://com.example.app/Wallet` — so every screen shares one origin, and each screen has its own path. |
There was a problem hiding this comment.
Keep the page-event reference aligned with this URL format
Users who follow the linked page event reference will still be told that mobile URLs are app://{screenName} and see app://Wallet in its sample payload (lines 26 and 112), while this new text says the same call emits app://<bundleId>/<name>. Since both pages document the same screen() event, update the reference and sample in this change so users do not receive conflicting schemas for mobile analytics exports and queries.
Useful? React with 👍 / 👎.
| | Behavior | Detail | | ||
| |:---------|:------------| | ||
| | Session start | The first event after install, or the first event after a session expires. | | ||
| | Session timeout | 30 minutes of inactivity. The next event after that starts a new session. | |
There was a problem hiding this comment.
Reconcile the common session_id documentation
The common-fields reference currently describes session_id for all Formo events as a daily-changing identifier (data/events/common.mdx:19), whereas this new mobile-specific table says it lasts only until 30 minutes of inactivity. Mobile users consulting the shared event schema will therefore get incompatible expectations for session counts and joins; qualify or update the shared reference when documenting this distinct mobile lifecycle.
Useful? React with 👍 / 👎.
The SDK emits app://<name> (the bundle-id-in-host variant was reverted to match the backend's page_path parsing); origin and page path are derived by the analytics pipeline, not encoded in the URL by the SDK. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Thanks — both valid. Status: 1. 2. The root cause isn't a docs issue — it's that the RN SDK PR (getformo/sdk-react-native#50) introduced an SDK-generated Holding the
The other two changes on this PR ( |
session_id is computed server-side by the events-gateway authorizer as a daily-rotating hash, not by the SDK — documenting a 30-min SDK-owned session was wrong and conflicted with data/events/common.mdx. The corresponding SDK change has been reverted. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The mobile SDK supplies its own session_id (30-min inactivity window) rather than using the server-derived daily value, because that derivation relies on origin/IP/browser user-agent — signals a native app does not provide meaningfully. Qualifies the shared common.mdx description so web and mobile no longer conflict. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The Play Install Referrer capture needs an optional native module and a rebuild — undocumented, it silently no-ops and the feature never works for anyone following the docs. Adds the setup step, a Web-to-mobile attribution section (Play link format, what lands on Application Installed, the iOS limitation), the attribution option, and the peer dependency row. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
this is the most amazing pr i have ever seen. thanks @keiloktql ! |
Summary
Documents three mobile-SDK behaviors that were missing from the docs, surfaced while working on P-2199. Docs-only; pairs with the SDK PR (getformo/sdk-react-native#50).
Changes to
sdks/mobile.mdxreset(). Now documents that the SDK assigns asession_idto every event, with the session-lifecycle rules (30-min inactivity timeout, persists across restarts, reset byreset()) and what it powers (Sessions / Duration / Bounce).user_agent— added to the "Mobile context" field table (it's sent on every event and is what resolves device/OS in analytics).screen()events are sent aspageevents, and that the screen name maps topage_url: app://<bundleId>/<name>(stable origin per app, one path per screen).P-2199
🤖 Generated with Claude Code
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.