I have 3 websites. The url is as follows abc.com abc.com/xyz abc.com/pqr abc.com is a main site. I want to generate google analytics code for abc.com/xyz Should I select sub domain option while creating GA code for abc.com/xyz or domain option?
I don't think you should select the subdomain option. The first thing that comes to my mind is to use the same exact code and different profiles for each domain with custom filters in each profile to segment one domain vs another. Make sure to create one profile that is "raw data" with no custom filters so if you screw up you still have all your data. Let me preface by saying never used custom filters this way before, however I have done a lot of subdomain integration and used custom filters for other purposes, so it seems to me that it would work. The best source of info I've found on advanced Google Analytics is Justin Cutroni's book Google Analytics: Understanding Visitor Behavior. It goes into advanced integrations quite in depth and was published in late 2010 so it's pretty up to date.
Definitely don't select the sub-domain option. You should be able to use the same analytics code for all 3 of those sites. To navigate to the generate code page >> click edit on your analytics overview page.
The code should be the same for the sites altogether. No need to add the same code on different sub-domains.