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

Fix identify users in analytics #5335

Merged
merged 14 commits into from
Jan 16, 2025
Merged

Fix identify users in analytics #5335

merged 14 commits into from
Jan 16, 2025

Conversation

poulch
Copy link
Member

@poulch poulch commented Jan 7, 2025

What type of PR is this?

  • 💅 Refactor
  • 🌟 Feature
  • 🔥 Bug Fix
  • 🔩 Maintenance
  • 🛠 Workflow CI/CD changes

Related Issues or Documents

  • closes #

Usage Instructions, Screenshots, Recordings

Have you written tests?

  • Yes!
  • No... here is why: Writing tests are mandatory, please replace this text with why test are not included in this PR

[Optional] Description

@poulch poulch requested a review from a team as a code owner January 7, 2025 09:20
@github-actions github-actions bot temporarily deployed to pr-5335 January 7, 2025 09:26 Destroyed
@@ -85,8 +83,6 @@ export function useAuthProvider({ intl, notify, apolloClient }: UseAuthProviderO
}
};
const handleLogout = async () => {
analytics.reset();
Copy link
Member

Choose a reason for hiding this comment

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

Question: how it will work now? We won't reset user if they are logging out?

Copy link
Member Author

Choose a reason for hiding this comment

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

We don't use our user_id to identify users so we rely on an auto-generated ID by Posthog, so when we run reset on logout and user login again, a new ID was generated.
For now, we will have one ID per device and only change the domain and email domain by setting user properties.

Cloud11PL
Cloud11PL previously approved these changes Jan 7, 2025
Copy link

changeset-bot bot commented Jan 7, 2025

🦋 Changeset detected

Latest commit: 441a867

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
saleor-dashboard Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot temporarily deployed to pr-5335 January 7, 2025 12:21 Destroyed
@github-actions github-actions bot temporarily deployed to pr-5335 January 7, 2025 12:27 Destroyed
@github-actions github-actions bot temporarily deployed to pr-5335 January 8, 2025 10:53 Destroyed
@github-actions github-actions bot temporarily deployed to pr-5335 January 8, 2025 11:10 Destroyed
@github-actions github-actions bot temporarily deployed to pr-5335 January 8, 2025 12:43 Destroyed
@github-actions github-actions bot temporarily deployed to pr-5335 January 9, 2025 09:36 Destroyed
@github-actions github-actions bot temporarily deployed to pr-5335 January 9, 2025 12:25 Destroyed
@github-actions github-actions bot temporarily deployed to pr-5335 January 10, 2025 22:36 Destroyed
@github-actions github-actions bot temporarily deployed to pr-5335 January 13, 2025 11:59 Destroyed
@andrzejewsky andrzejewsky merged commit 6909888 into main Jan 16, 2025
14 of 15 checks passed
@andrzejewsky andrzejewsky deleted the merx-1364-fix-posthog-auth branch January 16, 2025 12:50
poulch added a commit that referenced this pull request Jan 16, 2025
* Fix identify users in analytics

* Add changeset

* Restore IS_CLOUD_INSTANCE from env

* Track and set user properties

* Detect when user properties change and set only then

* Fix isCloudInstance

* Update ls data and add comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants