How to track and record an activity