Which one is correct for Google analytic code @ adding before </body> or before </head> one of my client site traffic is totally down compare to last months.
The correct option is to add Analytics code before closing Body Tag (</body>). I added before </body> and It's working fine.
Google recommends putting the asynchronous code in the header section of your site, if it is the previous version of code (traditional version) it used to get placed before the closing </body> tag. The code will still work if it is placed outside of the recommended areas of the page. If your clients site is loosing traffic check that the status of the tracker is ok.
Put it in your head tag, as Google states. There is a reason why they've changed the position from </body> to </head> I never liked the code before the </body>-tag and the reason Google did this is "for people with a slow internet connection, it could give a conflict." Come on, anno 2011...
Yeah the old code used to stop the page from loading until it had been executed which is why it went at the end of the page. The asynchronous code runs in parallel with the page load and so can be placed in the head
Both are correct. But i think you should place your G.A code before </body> tag. Otherwise your site bounce rate could be increased.
Well, code should be inserted before </head> thats what Google says. Google have different code types and according to the instructions most recent code should be placed before </head>
I believe that adding the analytics code before </body> was recommended by most well-known and trusted SEO gurus
It is better to add after BODY because it doesn't affect your site loading speed and its loaded in the end of all markup