refactoring google analytics to directive