Skip to content
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

PostHog Authentication to solve distinctId issue for analytics #27080

Open
macmetrep opened this issue Dec 19, 2024 · 2 comments
Open

PostHog Authentication to solve distinctId issue for analytics #27080

macmetrep opened this issue Dec 19, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@macmetrep
Copy link

Feature request

Is your feature request related to a problem?

With analytics, PostHog offloads the need to track distinctId onto the customer. This means we need to set up a backend service just for this alone or set up something like Firebase auth or auth0 to have a central store of user data to refer to.

Describe the solution you'd like

It would be nice if Posthog had a service like firebase auth so we could just get our distinctIds setup quickly

Describe alternatives you've considered

Firebase Auth, auth0

Additional context

I'm on iOS

Debug info

- [ ] PostHog Cloud, Debug information: [please copy/paste from https://us.posthog.com/settings/project-details#variables]
- [ ] PostHog Hobby self-hosted with `docker compose`, version/commit: [please provide]
- [ ] PostHog self-hosted with Kubernetes (deprecated, see [`Sunsetting Kubernetes support`](https://posthog.com/blog/sunsetting-helm-support-posthog)), version/commit: [please provide]
@macmetrep macmetrep added the enhancement New feature or request label Dec 19, 2024
@benjackwhite
Copy link
Contributor

Would love to understand a bit more what this would look like? Either you don't have a logged in user, in which case we create a distinctId for the app and use it, or you do and then you can specify it.

I'm not sure what it is you are asking for? Are you just generally saying it would be nice for PostHog to offer a full user authentication system like those other companies?

@macmetrep
Copy link
Author

macmetrep commented Dec 22, 2024

I'm not sure what it is you are asking for? Are you just generally saying it would be nice for PostHog to offer a full user authentication system like those other companies?

Yes, pretty much. I was thinking of setting an email as the distinctId, but I realized that had its own issues, and eventually, it became a need for a full user auth system.

As the user adds identifying info here and there to their profile, you need to use an identify call and that runs into the need to set your own distinctId since getting the distinctId that posthog generates for anon users is not very obvious from the ios library API. It is a natural extension of analytic user profiles with their userProperties and such.

I did eventually set up firebase auth + crashlytics, but that was an extra library integration step, and google's library adds a lot of binary size & memory usage (like 50 more MB!!) and their API is overcomplicated, while posthog would've been a much better experience memory and binary size wise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants