Google gives me a piece of javascript and tells me to include it in the <head>.
Can I put it at the end of <body> or will some side effects occur if I do that?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Putting it at the end of the
<head>section helps ensure the your metrics are tracked even when a user doesn’t let the page finish loading.They used to tell you to put it at the bottom of the page, before they added support for handling partial loading of pages.
Directly from Google:
See Google Analytics Help: Add the tracking code directly to your site