added analytics to head and mainhead