45 posts
  • Has been part of the Envato Community for over 6 years
  • Has collected 50+ items on Envato Market
  • Located in United States
cmF
says

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.

1401 posts
  • Won a Most Wanted contest
  • Has sold $10,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Pulled off some great moustache to raise money or awareness for Movember Australia
+7 more
greenline
says

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.

45 posts
  • Has been part of the Envato Community for over 6 years
  • Has collected 50+ items on Envato Market
  • Located in United States
cmF
says

Thanks! I was actually trying to verify ownership which is why I came across this discrepancy. It’s such a minor detail but I’m glad you noticed.

by
by
by
by
by
by