42 posts
  • Has been part of the Envato Community for over 5 years
  • Has collected 10+ 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.

1057 posts
  • Has sold $10,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Has been a beta tester for an Envato feature
  • Contributed a free file of the month
+6 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.

42 posts
  • Has been part of the Envato Community for over 5 years
  • Has collected 10+ 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