move analytics code into head