refactor google analytics