Memberscripts by Memberstack

#144 - Track Users Login History & Active Users

This script saves a daily record of each member’s logins and calculates their ongoing login streak. Every time a user logs in, the date is added to Memberstack’s JSON metadata. If they log in on consecutive days, their streak goes up by 1; if they miss a day, it resets to 0. It also keeps a running total of all visits, so you can easily track member engagement without any time limit.