We are deploying .war servlet,s on test and live.
I can’t be bothered putting conditional code to include analytics or not, can I use same code on both sites, and will analytics ONLY show the stats for the live site? (as that’s the registered domain)
Will it exclude test hits?
I recommend you leave on your Analytic test site: you have to test that the tracking works.
The conventional approach is to create an Analytics profile which takes into account only the test version and an other that excluded this version. You can do this thanks to the filters (based on your host or IP) in the Analytics interface.