Move analytics code to head section