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

前端 未结 7 1187
渐次进展
渐次进展 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 </head> tag.

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

    0 讨论(0)
提交回复
热议问题