fix bug where the domain wasn't correct in some sub-domain cases in the analytics script