Change analytics to before closing head