Added analytics hook