analytics hook