We have the same code in html and here to detect mobile devices. That's not good for maintenance. But I also can't see a possible way  to unify this...

Maybe pass a onMobile parameter to gaGlobalOptions and then re-use that here? Fishy, I know.