added analytics code