Better implementation of google analytics