Updated Google Analytics code to use the new API.