Fixed analytics code