Pregunta

I'm trying to get user details via Mixpanel analytics but I am having difficulties to properly grasp how i should do this… data has been set using

mixpanel.people.identify()

Events and Segmentation requests seem to be ok; but I can't figure out how to query a request on the Engage endpoint.

¿Fue útil?

Solución

as it turns out—there might be other ways to find this out but this one works for me: you need to get engagement data this way

$data = $mp->request(array('engage'));
foreach($data->results as $user) {
    $email = $user->{'$properties'}->{'$email'};
    $last_seen_date = $user->{'$properties'}->{'$last_seen'};
    $distinct_id = $user->{'$distinct_id'};
}

the distinct_id can then be used within the foreach() loop above to get events registered with this user:

$endpoint = array('stream', 'query');
$parameters = array(
        'distinct_ids' => json_encode(array($distinct_id)),
        'from_date' => '2014-02-10', 
        'to_date' => '2014-02-25',
);
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top