MixPanel 中 Wordpress 用户的 activity 提要为空

Wordpress user’s activity feed in MixPanel is empty

我刚刚将代码片段添加到我的 wordpress 主题的 header 中,添加了一条语句来识别每个使用其 distinct_id:

的用户
`<script type="text/javascript">
(function(e,a){if(!a.__SV){var b=window;try{var c,l,i,j=b.location,g=j.hash;c=function(a,b){return(l=a.match(RegExp(b+"=([^&]*)")))?l[1]:null};g&&c(g,"state")&&(i=JSON.parse(decodeURIComponent(c(g,"state"))),"mpeditor"===i.action&&(b.sessionStorage.setItem("_mpcehash",g),history.replaceState(i.desiredHash||"",e.title,j.pathname+j.search)))}catch(m){}var k,h;window.mixpanel=a;a._i=[];a.init=function(b,c,f){function e(b,a){var c=a.split(".");2==c.length&&(b=b[c[0]],a=c[1]);b[a]=function(){b.push([a].concat(Array.prototype.slice.call(arguments,
0)))}}var d=a;"undefined"!==typeof f?d=a[f]=[]:f="mixpanel";d.people=d.people||[];d.toString=function(b){var a="mixpanel";"mixpanel"!==f&&(a+="."+f);b||(a+=" (stub)");return a};d.people.toString=function(){return d.toString(1)+".people (stub)"};k="disable time_event track track_pageview track_links track_forms register register_once alias unregister identify name_tag set_config reset people.set people.set_once people.increment people.append people.union people.track_charge people.clear_charges people.delete_user".split(" ");
for(h=0;h<k.length;h++)e(d,k[h]);a._i.push([b,c,f])};a.__SV=1.2;b=e.createElement("script");b.type="text/javascript";b.async=!0;b.src="undefined"!==typeof MIXPANEL_CUSTOM_LIB_URL?MIXPANEL_CUSTOM_LIB_URL:"file:"===e.location.protocol&&"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js".match(/^\/\//)?"https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js":"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js";c=e.getElementsByTagName("script")[0];c.parentNode.insertBefore(b,c)}})(document,window.mixpanel||[]);
mixpanel.init("mytoken", {
  loaded: function(mixpanel) {
      var distinct_id = mixpanel.get_distinct_id();
      mixpanel.identify(distinct_id);
      mixpanel.people.set_once('$first_name', distinct_id);
  }
});
</script>`

而且它似乎工作得很好。现在,如果我转到 "segmentation" 并选择按 "people" > "first name" 过滤事件,我可以查看每个事件的发送者的完整报告,如果我转到 "people" > "explore" 我可以按预期看到完整的用户列表,但是当我选择其中一个用户并进入 "people" > "user profile" 时,"activity feed" 部分是空的"live view" 中也没有任何内容。 我们的事件是使用 top-right 菜单中的 "set up tracking" 选项创建的,我知道我们已经在事件和每个用户之间创建了某种关系 distinct_id 但它没有在正确的方法和找出正确设置的任何建议都将受到极大的赞赏。

引用我从混合面板社区得到的答案: http://community.mixpanel.com/t/wordpress-users-activity-feed-is-empty/1232

Events tracked via Autotrack are not shown within the activity feed of users within the "Explore" report and are also not shown within the "Live View" report. If you'd like event data to be shown within either of these two locations your best bet would be to use a hard-coded mixpanel.track() call. Events fired via the mixpanel.track() method will be shown within the activity feed as well as "Live View".

这是因为 activity 提要和混合面板中的实时视图显示了网站内跟踪的事件列表,您必须在您的网站中手动编码 mixpanel.track(eventName) 。由于您仅使用 mixpanel.identify()mixpanel.people.set_once() 将配置文件存储在混合面板中,因此您会在探索和细分中看到它。 在 mixpanel 中,您必须对需要跟踪的所有内容进行编码。 来自mixpanel documentation,简单事件跟踪的例子:

mixpanel.track(
   "Played song",
   {"genre": "hip-hop"}
);