# Engagement log

Engagement log is a feature to track user's engagement in an experience. Finally the data can be exported as a report.

# Tasks

  1. Create a new db with a table engagement_logs with id, user_id, timeline_id, date
  2. Create a new event in statistics lambda function
    • It checks if the last engagement log of this user is within 1 hour, if so, ignore the event
    • It writes the log to the new db table
    • It marks this user as engaged
  3. CORE/GraphQL will invoke this new lambda function event after decoding jwt
  4. Create a new column in enrolment table engagement_status. Valid values are uninvited, invited, engaged, disengaged, dropped, deleted
    • Add the logic to write the status accordingly in CORE
  5. On institution/experience setting page, admin can set the engagement period (user is defined as "engaged" if the last log is within X days)
  6. Write a cronjob in the new lambda function to run every day
    • This cronjob only checks live experiences
    • Check every user in an experience, if the user's engagement status is not valid anymore, update the status

# Engagement status

  • uninvited
    • User is enrolled but haven't send invite email
  • invited
    • Invitation email has sent to the user but user do not have any engagement log
  • engaged
    • User have engagement log within X days (configured in experience/institution)
  • disengaged
    • User doesn't have engagement log within X days (configured in experience/institution)
  • dropped
    • Admin mark the user as dropped
  • deleted
    • Admin mark the user as deleted

# Questions

  1. Are there any logic to apply for "dropped" user?
    1. Dropped user won't be able to access the experience anymore
    2. Dropped user won't be calculated for engagement/disengagement
  2. Where do we export the report? What should the report look like?