Hey so I came across this article – https://support.google.com/analytics/answer/1008080?hl=en and many other Google articles like it that say your tracking code should go immediately before the </head> tag.
I thought traditionally, this has always been done in the footer, right before the tag? In fact, many Wordpress Themes allow you to insert your tacking code into the WP Backend and it’s automatically placed at the bottom of the page before the tag.
Can anyone explain if there is a difference, and which one if any is better? Thanks.
- Author had a Free File of the Month
- Grew a moustache for the Envato Movember competition
- Sold between 10 000 and 50 000 dollars
- Beta Tester
- Envato Studio (Microlancer) Beta Tester
- Exclusive Author
- Bought between 50 and 99 items
- Referred between 1 and 9 users
- Has been a member for 1-2 years
Google requires the tracking code to be in the HEAD tag to be able to use it to verify your website ownership via the Google Webmaster Tools: https://support.google.com/webmasters/answer/185871?hl=en
Google Webmaster Tools is a set of tools for SEO and site analysis, especially useful when you wish to find the search keywords, etc
Otherwise, if you don’t use the Google Webmaster Tools, then you can place the code before the ending BODY tag.