Should Google Analytics go in the head or bottom of an HTML page?

前端 未结 7 1191
渐次进展
渐次进展 2021-02-02 12:14

Google advises putting the google analytics script right before closing the .

However, I would prefer to combine it with the rest my javascript

7条回答
  •  失恋的感觉
    2021-02-02 12:36

    Implementing the code Once you find the code snippet, copy and paste it into the bottom of your content, immediately before the tag of each page you are planning to track. If you use a common include or template, you can enter it there. To implement tracking code for secure pages (e.g. https://), please read How do I obtain tracking code for secure pages?

提交回复
热议问题