Forum Discussion

Yunus's avatar
Yunus
Active Member
2 years ago

3 consecutive days

Hi, we would like to send campaigns to the user who opens the app for 3 consecutive days and opens app for 7 consecutive days. How can I filter those users? does X session in Y days work?

  • DanyWillis's avatar
    DanyWillis
    Practitioner III

    Yep, consider using a decision split as well, you could branch out the conversation further that way, 1 day, 2 days, 3 days, for example...

  • bob's avatar
    bob
    Specialist

    Will the ' X session in Y days' work? That feels like it might count three sessions on day three as meeting the criteria. You should probably test that.

    I'd probably approach it explicitly tracking whatever event means the app has been opened - maybe even a session-start event (you could trigger a webhook campaign with this) and maintain a record of the date/time of the last open and count of current consecutive opens.

    Then, as that open happens, see if the last open was in the previous day and if so, update the last-opened attribute and increment the count.

    You'd then either need to create a daily, always-on campaign to reset the count to zero for anyone that didn't open the day before.

    OR, whenever you check the count, always check the last-opened attribute to make sure it's recent.

    Not difficult logic to implement in liquid.