To avoid any JS errors, wrap the ga function and only call it if it exists.