restore analytics code