You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In applications, particularly those using backend authentication like with Supabase, there’s a lack of a clear event on the front-end to trigger user identification for analytics. This scenario can lead to challenges in properly identifying users without causing duplicate identification events in PostHog. Currently, PostHog does not offer a built-in method to check if a user has already been identified, which can lead to redundant data collection and inaccuracies in user tracking.
Problem Statement:
Our application utilizes Supabase for authentication, where the authentication process is managed through backend routes, and no distinct front-end event is triggered for user logins. This setup necessitates a workaround for identifying users on the front-end, which we’ve attempted with local storage and React’s useState effect. However, this approach has proven to be less than ideal, sometimes causing the ‘identify’ event to trigger multiple times for a single user session. This issue could potentially lead to skewed analytics and user data.
Current Workaround:
We have attempted to mitigate this issue by using a combination of local storage and a ‘useState’ effect in our front-end code to check for user identification. This solution, however, is not foolproof and has led to instances of duplicate identifications.
Proposed Solution:
I propose that PostHog introduces a feature or mechanism that allows developers to check if a user has already been identified in the current session or through a persistent session marker. Such functionality could resemble a method similar to posthog.__loaded but specifically for checking user identification status, e.g., posthog.__identified.
This feature would greatly enhance the developer’s ability to manage user identification efficiently, especially in applications where authentication is handled outside of traditional front-end events.
Impact:
Implementing this feature would significantly improve data accuracy for developers leveraging PostHog for user analytics, especially in complex authentication setups. It would reduce redundancy in data collection and ensure a more accurate representation of user sessions and interactions with the application.
The text was updated successfully, but these errors were encountered:
Summary:
In applications, particularly those using backend authentication like with Supabase, there’s a lack of a clear event on the front-end to trigger user identification for analytics. This scenario can lead to challenges in properly identifying users without causing duplicate identification events in PostHog. Currently, PostHog does not offer a built-in method to check if a user has already been identified, which can lead to redundant data collection and inaccuracies in user tracking.
Problem Statement:
Our application utilizes Supabase for authentication, where the authentication process is managed through backend routes, and no distinct front-end event is triggered for user logins. This setup necessitates a workaround for identifying users on the front-end, which we’ve attempted with local storage and React’s useState effect. However, this approach has proven to be less than ideal, sometimes causing the ‘identify’ event to trigger multiple times for a single user session. This issue could potentially lead to skewed analytics and user data.
Current Workaround:
We have attempted to mitigate this issue by using a combination of local storage and a ‘useState’ effect in our front-end code to check for user identification. This solution, however, is not foolproof and has led to instances of duplicate identifications.
Proposed Solution:
I propose that PostHog introduces a feature or mechanism that allows developers to check if a user has already been identified in the current session or through a persistent session marker. Such functionality could resemble a method similar to posthog.__loaded but specifically for checking user identification status, e.g., posthog.__identified.
This feature would greatly enhance the developer’s ability to manage user identification efficiently, especially in applications where authentication is handled outside of traditional front-end events.
Impact:
Implementing this feature would significantly improve data accuracy for developers leveraging PostHog for user analytics, especially in complex authentication setups. It would reduce redundancy in data collection and ensure a more accurate representation of user sessions and interactions with the application.
The text was updated successfully, but these errors were encountered: