Rearranging some code to try and get GA goals working