sample code for tracking tabs