adding ajax hook code for analytics