简体   繁体   English

Mixpanel JavaScript集成:连续事件在mixpanel末端以错误的顺序记录

[英]Mixpanel javascript integration: consecutive events are recorded in wrong order at mixpanel end

I am recording two events in a web page 我正在网页中记录两个事件

  1. Register 寄存器
  2. Plans complete 计划完成

Those two events are recorded in that page as the user can register and complete the process (the user registration internally handled in the form submission and records it in the complete page). 这两个事件记录在该页面中,因为用户可以注册并完成该过程(用户注册在表单提交中内部处理,并将其记录在完整页面中)。 Those events recording JS code is in consecutive line in above order. 那些记录JS代码的事件按上述顺序连续显示。

Those events related mixpanel.track function calls are issued in order. mixpanel.track函数调用相关的那些事件按顺序发出。 The issue is sometimes the Plan complete event recorded before the Register in the server. 问题有时是在服务器中注册之前记录的计划完成事件。 I have inspected the Mixpanel's live view and notice that this happens randomly with a probability of 0.1 approximately. 我检查了Mixpanel的实时视图,并注意到这种随机发生的可能性约为0.1。

I want to know if there is a way to overcome this issue by setting a order number or local time stamp or any other way. 我想知道是否有办法通过设置订单号或本地时间戳来解决此问题。

My environment is : 我的环境是:

  • Mixpanel: JS library Mixpanel:JS库
  • Browser: chrome in windows 7 浏览器:Windows 7中的Chrome

First please add a snippet of your mixpanel calls. 首先,请添加您的混合面板调用的代码段。 But if you are just firing the second event in code without user input just call the second mixpanel.track('event2') in a callback for the first call. 但是,如果您只是在没有用户输入的情况下触发代码中的第二个事件,则只需在第一个调用的回调中调用第二个mixpanel.track('event2')
ex.: 例如:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM