Closed afgarcia86 closed 8 years ago
I haven't tried it but I'd imagine it'd be something like this:
client = Mixpanel::Client.new(
api_key: 'changeme',
api_secret: 'changeme'
)
data = client.request(
'engage',
where: 'expression'
)
Ah I figured, I am still have trouble properly writing the expression, not on you but the mix panel docs are not super clear to me as a more novice developer. If you are familiar with it mind writing a sample expression?
I'm not familiar with the syntax of the expression unfortunately. However, if you find the solution, feel free to post it here.
@afgarcia86 I have found this to work for me:
props = [ (properties[\"uid\"] == \"#{mixpanel_id_a}\") or (properties[\"uid\"] == \"#{mixpanel_id_b}\") ]
parameters = { 'selector' => props }
client.request('engage', parameters)
https://mixpanel.com/docs/api-documentation/data-export-api#engage-default
I guess this isn't technically an issue but I am hoping you can explain how I would use the engage endpoint? How would I properly pass a value in the where field?
ex: I want to query for a user that has the ID that equals X