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

user's properties can't update #27092

Open
AruSeito opened this issue Dec 20, 2024 · 1 comment
Open

user's properties can't update #27092

AruSeito opened this issue Dec 20, 2024 · 1 comment
Labels
bug Something isn't working right

Comments

@AruSeito
Copy link

AruSeito commented Dec 20, 2024

Bug Description

Bug description

When using posthog-react-native, I repeatedly use the following code:

posthog.capture("set_user_properties", {
        $set: {
          utm_source: utm_source,
        },
        $set_once: {
          $initial_utm_source: utm_source,
        },
      });

However, the user profile is not being updated, even though I can clearly see two different utm_source values in the user panel.

How to reproduce

1.Set utm_source = test_source1 and use the above method. At this point, in the event panel of the user profile, the set_user_properties event is correctly logged, and both initial_utm_source and latest_utm_source are displayed correctly. The user properties appears to be updated as expected.
2.Change utm_source = test_source2 and repeat the steps from the first scenario. While the event panel still shows the correct values, but the latest_utm_source in the user properties do not get updated.

Additional context

image
2.
image
3.
image

Debug info

Session: https://us.posthog.com/project/sTMFPsFhdP1Ssg/replay/0193e1f6-18bb-7a17-9f62-e9b4b99ffa6b?t=3182
Admin: http://go/adminOrgUS/018f8629-1401-0000-c583-ef18814a6270 (project ID 75245)
Sentry: http://go/sentryUS/75245
@AruSeito AruSeito added the bug Something isn't working right label Dec 20, 2024
@Davidmoreen
Copy link

Davidmoreen commented Dec 21, 2024

Hey @AruSeito, this does looks like a bug when setting $initial_utm_source (with dollar sign) inside of $set_once that would need to be looked into.

In the mean time though, you can change your code to:

posthog.capture("set_user_properties", {
    $set: {
        utm_source: utm_source,
    }
});

And PostHog will generate an initial value and save it to the person. utm_source is a campaign property and will get it's initial value set automatically.

CORRECTION: this doesn't seem to be working either. 👀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working right
Projects
None yet
Development

No branches or pull requests

2 participants