Www and non-www in Google Analytics

I have two website profiles in Google Analytics: say http://www.example.com and http://example.com

Which tracking code do I install? Because I can only install one code on my site. If I install the www version one and someone visits my non-www website, then is Google Analytics report underreporting?

You only need one profile, and all visits will be counted.

There is option in Google Sitemaps which allows you set you proffered domain name. Preffered domain name is solution to your question.

Generally you put analytic code in your index or most common pages like header or footer.

So, in both of cases same pages would be download.

You dont need to to use two profile otherwise google can take any action for your website (I am not sure but may be).

Thanks

well, I agree google. inorder to keep track of website analysis, google analytics provide you the code which you need to add in either header or footer of your website. so it does not matter either you keep the www or non www version all of your visits will be counted, however in order to get rid of this www and non www issue use google webmaster tools and there you have the option to choose.

You better choose one profile and follow the 301 redirect method.