refactored google analytics