Skip to content

Document mobile session_id, user-agent, screen paths, and Android attribution (P-2199 + P-2207)#110

Merged
keiloktql merged 5 commits into
mainfrom
docs/p-2199-mobile
Jul 21, 2026
Merged

Document mobile session_id, user-agent, screen paths, and Android attribution (P-2199 + P-2207)#110
keiloktql merged 5 commits into
mainfrom
docs/p-2199-mobile

Conversation

@keiloktql

@keiloktql keiloktql commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

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.mdx

  • Session management — was only reset(). Now documents that the SDK assigns a session_id to every event, with the session-lifecycle rules (30-min inactivity timeout, persists across restarts, reset by reset()) 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 paths — documents that screen() events are sent as page events, and that the screen name maps to page_url: app://<bundleId>/<name> (stable origin per app, one path per screen).

P-2199

🤖 Generated with Claude Code


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

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>
@linear-code

linear-code Bot commented Jul 20, 2026

Copy link
Copy Markdown

P-2199

P-2207

@mintlify

mintlify Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
formo 🟢 Ready View Preview Jul 20, 2026, 7:58 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@mintlify

mintlify Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
formo 🟡 Building Jul 20, 2026, 7:58 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@keiloktql keiloktql self-assigned this Jul 20, 2026
@keiloktql
keiloktql requested a review from yosriady July 20, 2026 08:00
@yosriady

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread sdks/mobile.mdx Outdated
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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment thread sdks/mobile.mdx
| 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. |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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>
@keiloktql

Copy link
Copy Markdown
Contributor Author

Thanks — both valid. Status:

1. page event reference alignment — resolved. Codex reviewed e1d39db, before the correction in 5e2f29a. The SDK's bundle-id-in-host format was reverted (it conflicted with the Tinybird page_path parser in getformo/formono#2033, which would have leaked the bundle id into the path). This page now says app://Wallet / app:///tabs/leaderboard, which matches data/events/page.mdx (app://{screenName}, sample app://Wallet). No conflicting schemas remain.

2. session_id conflict — real, and it's blocked on a design decision. data/events/common.mdx describes session_id as a "privacy-friendly daily changing session identifier" (64-char hex hash in both samples), while this page documents a UUID with a 30-minute inactivity timeout. Those are genuinely incompatible definitions, and Codex is right that mobile users would get the wrong expectations for session counts and joins.

The root cause isn't a docs issue — it's that the RN SDK PR (getformo/sdk-react-native#50) introduced an SDK-generated session_id, whereas the platform's documented model looks server-computed at the ingestion edge. I've raised that on the SDK PR and it needs confirmation before we document either behavior.

Holding the session_id section here until that resolves, rather than documenting a behavior that may be reverted:

  • If the edge owns session_id → the SDK-side change gets reverted and this section comes out (shared reference stays correct as-is).
  • If it's SDK-owned → common.mdx needs updating to qualify web vs mobile, and this section stays.

The other two changes on this PR (user_agent in the mobile context table, and the screen page_url format) are independent and correct either way.

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>
@keiloktql keiloktql changed the title P-2199: Document mobile session_id, user-agent, and screen paths P-2199: Document mobile user-agent and screen page paths Jul 21, 2026
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>
@keiloktql keiloktql changed the title P-2199: Document mobile user-agent and screen page paths P-2199: Document mobile session_id, user-agent, and screen page paths Jul 21, 2026
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>
@keiloktql keiloktql changed the title P-2199: Document mobile session_id, user-agent, and screen page paths Document mobile session_id, user-agent, screen paths, and Android attribution (P-2199 + P-2207) Jul 21, 2026
@keiloktql
keiloktql merged commit 5e9917a into main Jul 21, 2026
6 checks passed
@keiloktql
keiloktql deleted the docs/p-2199-mobile branch July 21, 2026 08:31
@Ducksss

Ducksss commented Jul 21, 2026

Copy link
Copy Markdown

this is the most amazing pr i have ever seen. thanks @keiloktql !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants