moved tracking code to top