Updated header comment. Added condition isUserEvent to which events are considered for engagement.