Mixpanel javascript integration: sequential events are written in the wrong order at the end of the mixpanel

I am recording two events on a web page

  • registration
  • Plans completed

These two events are recorded on this page, since the user can register and complete the process (user registration is internally processed in the form and writes it to the full page). These JS code-writing events are in a sequential line in the order shown above.

Those related events mixpanel.track function calls are written out in order. Sometimes the question arises about the completion of the plan recorded in front of the Register on the server. I looked at the Mixpanel in real time and noticed that this happens randomly with a probability of approximately 0.1.

I want to know if there is a way to overcome this problem by setting the order number or local timestamp or in any other way.

My environment:

  • Mixpanel: JS library
  • Browser: chrome in windows 7
+6
source share
1 answer

First, add a snippet of your calls with the mixed panel. But if you just fire the second event in the code without user input, just call the second mixpanel.track('event2') in the callback for the first call.
eg:

 mixpanel.track('event1', function(result){ mixpanel.track('event2'); }; 
+2
source

Source: https://habr.com/ru/post/981666/


All Articles