updating code to supprt Google Analytics