Moving analytics tracking code to head