Whether the placing Google Analytics Cod in the head would be better or placing it in the body . please help.
There is no difference my friend... just make sure you put the tracking code as they suggest and test before publishing it so that it does not screw your site.
as Jack says, if you have already gotten the code or had a look at analytics, it would have told you exactly what to do. I have never had a problem with the code interfering with any sites function.
Placing the code in header would be better because the website loads in that order, haeder first. If someone leaves your site within one or two seconds after entring your sites, GA may not track it if the code is somewhere to the end because the code hasn't been loaded yet.
Dear friend, You just place any where in web page but end point is best for placing tag. Actually for developer point of view you don't want to confusion about making code for website. Then you place code either head section or before end of Body tag </body> in web Page.
I would recommend to put analytics (and other third party codes) to the footer because if (for any reason) any of these scripts do not load then your site should not stuck.
When you put any website in GA. Google will guide you where they want you to add the tracking code. Either before the <head> tag or before the end of <body> tag
its not the matter where u place , it will work even if u place in the head or in the body but for u r convenience place it in the body to easily identify the code.
All right!! Google Analytics script will work everywhere on the page but placement depends on your requirements suppose we have pasted it in header section of website it will be loaded before loading of complete page and suppose meanwhile the visitor has closed the tab, it will counted as a visit in Google Analytics Report but actually it was nothing because visitor had closed the tab before the page loads properly. in second scenario if we post it before </body> tag Google Analytics code will be loaded after the loading of complete page and because visitor is still on the page that's a real visit that data is useful for us to track. So I will suggest you to paste it before closing of body tag, and of course embed it in your dynamic footer its smart practice if you are dealing with dynamic site