0

Is it possible to get retention data from Mixpanel?

Here at Klipfolio Support, there have been many questions on getting Mixpanel Retention data. So, here's a sample endpoint that can help you get retention data from Mixpanel:

http://mixpanel.com/api/2.0/retention/?expire={hash.getExpiryTime(240)}&from_date={date.addMonths(-4).startOfMonth}&retention_type=compounded&to_date={date.today}&unit=week&api_key=<YOUR API KEY>&sig={hash.append("api_key=<YOUR API KEY>").append("expire=").append(hash.getExpiryTime(240)).append("from_date="+date.addMonths(-4).startOfMonth).append("retention_type=compounded").append("to_date="+date.today).append("unit=week").append("<YOUR API SECRET>").encodeMd5().toHex().printDigest()}

** Replace <YOUR API KEY> with your API key and <YOUR API SECRET> with your API Secret.

The above endpoint URL is getting the last 4 months of retention data.

 

** Another Eg, where event is specified as one of the parameters-

http://mixpanel.com/api/2.0/retention/?event=<Event_Name>&expire={hash.getExpiryTime(240)}&from_date={date.addMonths(-3).startOfMonth}&retention_type=compounded&to_date={date.today}&unit=week&interval_count=13&&api_key=<YOUR API KEY>&sig={hash.append("api_key=<YOUR API KEY>").append("event=<Event_Name>").append("expire=").append(hash.getExpiryTime(240)).append("from_date="+date.addMonths(-3).startOfMonth).append("interval_count=13").append("retention_type=compounded").append("to_date="+date.today).append("unit=week").append("<YOUR API SECRET>").encodeMd5().toHex().printDigest()}

 

Notes:

The above endpoint is for retention_type=compounded. If you want to use retention_type=birth in the query, you'll need to add this parameter: born_event=<yourEventName>.

More info on Retention can be found here: https://mixpanel.com/docs/api-documentation/data-export-api

Hope this helps!

Kavya

2 comments

  • 0
    Avatar
    Oded Reuveny

    this didn't work for me

  • 0
    Avatar
    Kalyani Khandelwal

    Hi Oded,

     Thank you for your feedback. Could you please send us more information about your use case on support@klipfolio.com? Please also send us the query which you are using.

     

    Thanks,

    Kalyani

Please sign in to leave a comment.