adding fix for #590, #581 because I'd added them to the wrong branch before. Also adding Google Analytics tracking code.