javascript cleanup and changed google analytics method