Updated GA code - check if `gaq` is defined