Moved analytics code