added analytics code.