Hey, I have a question regard the user id for Mixp...
# ask-questions
c
Hey, I have a question regard the user id for Mixpanel integration. The example uses the
mixpanel.get_distinct_id()
function to set the growthbook user attr id. I assume we can switch this out to be a long live id as mixpanel device ids change when users logout. Does this effect report on experiments at all? Would we need the long live id in Mixpanel?
w
Hi Peter. Having longer lived ids are better so that users stick to a single variation. Many implementations have both logged in ids and logged out - anonymous ids. Both can be set as attributes. When you start your experiment you can choose which id that you should target based upon which type of users it is aimed at.
c
Thanks for the link that was helpful. What happens if you want to track a user through the funnel, when in our instance they will have logged in, before they purchase. The bit I'm struggling to understand is if we set a
sessionId
how does GB use this to track events in from the Mixpanel data as our
sessionId
doesn't relate to our users in Mixpanel/
w
If you set multiple ids that in Growthbook you can create an Identifier Join query to link the two up: https://docs.growthbook.io/app/datasources#identifier-join-tables.
c
Ah perfect, I'll have a read 👍