Small modification to setUserIdFromLocation and setUserIdFromReferrer