Move analytics code