Mixpanel User Tracking Issue: Identifying Checkout Calls and Order Completion
Hi all! We are using segment to track events for our analytics which connects to mixpanel. We are making a mix of identify and track calls client and server side in the following chain checkout started - frontend track call checkout year group - frontend track call checkout subject - frontend track call checkout choose payment - frontend track call checkout end - frontend track call order_complete - backend track call identify - frontend call The checkout calls happen in a self serve checkout flow where the user chooses their year group and subjects and payment type and then they pay. After the checkout end call, the user is redirected to stripe and after filling their details and paying they are redirected back to the website on a student registration page where the identify call happens. The backend track call for order complete happens in a stripe webhook listener which fires as soon as it receives a checkout.session.complete event from stripe (so it normally happens before the identify call on the frontend ). The problem is that we are receiving the checkout calls and the order complete calls in mixpanel but they are not getting attached to the same user. The checkout calls happen with an anonymous user and the order complete call happens with a user id which we set for that user after they have paid - the customer id. The identify call happens with the same customer id. On Segment i can see that the anonymous id on the order complete track call is the same as the anonymous id on the checkout calls. How come they are not getting attached to the same user in mixpanel. I hope this was a clear explanation of what is happening, and i apologise for parts of this where there is bad grammar. Look forward to a reply!