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

$set properties not getting sent in captureEvent #1019

Open
aseemk opened this issue Feb 12, 2024 · 0 comments
Open

$set properties not getting sent in captureEvent #1019

aseemk opened this issue Feb 12, 2024 · 0 comments

Comments

@aseemk
Copy link

aseemk commented Feb 12, 2024

Hi there! I'm new to PostHog and generally loving it so far — thank you. =)

I'm seeing some surprising behavior which seems like a bug. But this was working earlier last week, so it's very possible I've caused a regression on my end — but I didn't change anything here, and the code looks so simple, so I'm not sure.

I'm capturing an event like this:

  posthog.capture(name, props, {
    $set: user,
  })

And logging a line immediately above this confirming the values of the variables are set as I think they are:

  console.log('calling `posthog.capture` with:', {
    name,
    props,
    options: {
      $set: user,
    },
  })

My log prints correctly:

You can see I'm passing custom properties to $set on the person, like name and gender.

I'm unfortunately not seeing these properties get set on the person in PostHog, or passed through in $set on this event:

And when I enable posthog.debug(true) on my posthog-js instance, I similarly don't see any $set passed with the event:

Screenshot 2024-02-12 at 9 29 36 AM

(I also don't see any other debug lines printed for other sends immediately after this, e.g. identify. And to be clear, we are calling posthog.identify() before this, on initial page load, and I do see $set being included there.)

Am I doing something wrong here, or misunderstanding the API?

I'll try calling an explicit separate setPersonProperties instead for now, but wanted to file this bug in the meantime. Thank you!

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

No branches or pull requests

1 participant