Added analytics
moved script block