added function for tracking sample engagement