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

前端 未结 7 1193
渐次进展
渐次进展 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:47

    From Google Analytics setup instructions:

    Paste your snippet (unaltered, in it’s entirety) into every web page that you want to track. Paste it immediately before the closing tag.

    If your website uses templates to generate pages, enter it just before the closing tag in the file that contains the section.

提交回复
热议问题