Where should the Analytics tracking code be placed in the HTML of a webpage for data collection?
Just before the closing </body> tag
Just after the opening <head> tag
Just before the closing </head> tag
Just after the opening <body> tag
or
- Just before the closing </body> tag of your website
- Just after the opening <body> tag of your website
- Just before the closing </head> tag of your website
- Just after the opening <head> tag of your website
Explanation:
You just need to paste the entire snippet into the HTML on your web pages, just before the closing </head>tag.
This is a confusing question. Please note that the correct answer is “Just before the closing </head> tag” at the current version of Google Analytics Individual Qualification Exam in English. We will update this file if/when it changes. Note that in Google Analytics Academy assessments a correct answer is different to the same question -Just after the opening <head> tag. Moreover, if you take GAIQ exam in French the correct answer is also “Just after the opening <head> tag”.
In both scenarios GA code will be render blocking and will slow down your website. The best solution is to host analytics locally and put tracking code in the footer.
Read more here: https://support.google.com/analytics/answer/1008080