One way to do this is if your page code points to the same profile (the same UA-XXXXXXX-X), but sets up individual profiles based on the same profile and uses filters to send data based on subdomains.
This way you do not have to bother with multiple versions of your page code. But you will need to add the following to your page code for all your pages (on all your subdomains) (before calling trackPageview) to track the tracking of all subdomains:
_gaq.push(['_setDomainName', '.example.com']);
Then you should apply a filter to each profile with:
Filter Name: site1 traffic (Predefined filter) Filter type (dropdown values): Include only : traffic from the domains : that are equal to Domain: site1.example.com
Do this for each profile that you have configured for each site X
As for No. 2, you will only have the first profile, which you will deduce from all other profiles (above) as a "global swap" without any filters so that it receives all the traffic.
And you can specify who has access to those profiles in the profile editor.
One bummer: you will need to enter and configure your goals separately in each profile.
source share