Adding analytics code