Mixpanel Community Icon

Creating User Cohorts Based on Last Subscription Status Event

·
·

Hi, is there any way to create a cohort based on the last instance of certain event. we have an event that tracks transition of the user between different subscription statues - free, trial and paid. the event has two properties, current_plan and new_plan, that tracks the transition. for example when user signs for the trial, the event fires with current_plan as free and new plan as trial. i want to create a cohort of users based on the last instance of the event. for example, last instance of the event with new_plan=paid means active paid users.

  • Avatar of Vlad S.
    Vlad S.
    ·
    ·

    it's not exactly what you asked, but one way of doing it is to set a user property like plan and whenever you trigger a plan change event you also update the plan property to match their new plan

  • Avatar of Vlad S.
    Vlad S.
    ·
    ·

    you could also create a cohort saying "did Plan Change event where plan is paid and then didn't do Plan Change event", like this

  • Avatar of Vlad S.
    Vlad S.
    ·
    ·

    I've not tried that, so I don't know how well it works, but it's worth a shot

  • Avatar of Mukesh A.
    Mukesh A.
    ·
    ·

    thanks,

  • Avatar of Vlad S.
    Vlad S.
    ·
    ·

    I'd say the first approach is more robust (and kinda how user properties are meant to be used) while the latter approach is a bit more hacky

  • Avatar of Mukesh A.
    Mukesh A.
    ·
    ·

    i prefer first approach as well, but i don't think i can create a behavior property in mixpanel UI, this requires code change, and our implementation is server side, so requires dev bandwidth. let me know if possible to create such user property through custom behavior property feature in mixpanel.

  • Avatar of Vlad S.
    Vlad S.
    ·
    ·

    no, I don't think you can, aside from in the Users view, which is temporary; fwiw the dev lift on this would be minute, it should be a literal one line of code addition (although it's hard to know for sure, without seeing your codebase)