API for tracking generic events