Skip to content

Fix identify users in analytics#5335

Merged
andrzejewsky merged 14 commits intomainfrom
merx-1364-fix-posthog-auth
Jan 16, 2025
Merged

Fix identify users in analytics#5335
andrzejewsky merged 14 commits intomainfrom
merx-1364-fix-posthog-auth

Conversation

@poulch
Copy link
Contributor

@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
@poulch poulch requested review from kzuraw and witoszekdev January 7, 2025 09:20
@github-actions github-actions bot temporarily deployed to pr-5335 January 7, 2025 09:26 Destroyed
}
};
const handleLogout = async () => {
analytics.reset();
Copy link
Contributor

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
Contributor 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
@changeset-bot
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
@poulch poulch added the run pw-e2e Run e2e (basic suite from PR automation) label Jan 7, 2025
@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

Labels

run pw-e2e Run e2e (basic suite from PR automation)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants