我想通过他们的PHP API获取Mixpanel上用户的特定数据。例如,我想知道用户X执行AppLauch事件的次数是多少?
$mp = new Mixpanel($api_key,$api_secret);
//Create single point array with API endpoint
$endpoint = array('segmentation');
//Create array of properties to send
$parameters = array(
'event' => 'AppLaunch',
'user_id' =>'X',
'from_date' => '2012-12-10',
'to_date' => '2012-12-12'
);
//Make the request
$data = $mp->request($endpoint, $parameters);
print_r($data);
答案 0 :(得分:2)
点击用户后,查看在“浏览”页面上进行的查询。
$endpoint = array('stream', 'query');
$parameters = array(
'distinct_ids' => json_encode(array('X')),
'from_date' => '2012-12-10',
'to_date' => '2012-12-12'
);