fixed logic for google analytics