-
Notifications
You must be signed in to change notification settings - Fork 735
feat: add mobile-to-web cross-platform tracking tutorial #14541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@codex review this please |
There was a problem hiding this comment.
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: eda97732d1
ℹ️ 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".
| Append `distinct_id` and `session_id` as query parameters when opening the URL. Here's an example using an in-app browser: | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid sending distinct_id/session_id in query params
Using query parameters here means the IDs are sent to your web server and can be recorded in access logs, caches, and referrer headers to third-party resources; if distinct_id is a stable identifier (email/user ID), this leaks PII and can create compliance issues. The cross-domain tutorial in this repo uses a URL hash for this reason; consider using a fragment (#distinct_id=...) or a short‑lived token exchange so the IDs stay client‑side.
Useful? React with 👍 / 👎.
| let distinctId = PostHogSDK.shared.getDistinctId() | ||
| let sessionId = PostHogSDK.shared.getSessionId() ?? "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use supported mobile SDK API for session ID
The tutorial calls getSessionId()/sessionId() on the iOS/Android SDKs, but the iOS and Android SDK docs in this repo only document getDistinctId()/distinctId() and do not expose a session‑ID accessor. As written, these examples will not compile for users following the current SDK docs, so they can’t obtain the session_id needed for bootstrapping. Either switch to a supported API (or document how to access $session_id in mobile SDKs) before instructing readers to pass it.
Useful? React with 👍 / 👎.
WIP WIP WIP!
I still need to de-llm this a bit but I am opening the PR to see how it looks because my local repo is not working
Checklist
vercel.jsonArticle checklist