Add Google Analytics code, some minor migration fixes