Question

How do I carry guest's property to user's property?

  • 12 May 2020
  • 1 reply
  • 224 views

I'm new to Mixpanel, and I'm tracking a platform website. Right now I'm planning to record the first product viewed by a guest (not yet a user)

if (_.isEmpty(this.user)) {
mixpanel.identify(mixpanel.get_distinct_id())
}
else {
mixpanel.identify(this.user.id)
}
mixpanel.people.set_once({
'First product viewed': this.product.name
})

But for some reason, when the guest becomes a user, their profile's property doesn't contain this info anymore.

Am I missing something?


1 reply

Userlevel 1
Badge

Hi! It sounds like what may be happening here is that the distinct ID of the user is being changed somehow from when they are a guest to when they become a user. Your code looks correct in that what should happen is a user profile should be created for the ‘Guest’ when you call mixpanel.people.set.once() and that profile should contain the ‘First Product Viewed’ user property. That profile will be associated with the guests distinct ID so if the guests distinct ID is changed when they become a ‘User’, the new profile for the ‘User’ will not contain the ‘First Product Viewed’ property as that property will still be associated to the distinct ID the user had when they were still a ‘Guest’.

 

In your implementation are you calling mixpanel.reset() anywhere or are you perhaps changing a users distinct ID when they register by calling Mixpanel.Identify(NewUserIdValue)? 

 

Rishi

Support Engineer

Reply