Refactored Analytics event jquery block