Skip to content
Permalink
Newer
Older
100755 40 lines (30 sloc) 2.06 KB
Jan 28, 2020
1
[HTML5 Boilerplate homepage](https://html5boilerplate.com/) | [Documentation
2
table of contents](TOC.md)
3
4
# Frequently asked questions
5
6
* [Why is the Google Analytics code at the bottom? Google recommends it be
7
placed in the `<head>`.](#why-is-the-google-analytics-code-at-the-bottom-google-recommends-it-be-placed-in-the-head)
8
* [Do I need to upgrade my site each time a new version of HTML5 Boilerplate is
9
released?](#do-i-need-to-upgrade-my-site-each-time-a-new-version-of-html5-boilerplate-is-released)
10
* [Where can I get help with support
11
questions?](#where-can-i-get-help-with-support-questions)
12
13
---
14
15
### Why is the Google Analytics code at the bottom? Google recommends it be placed in the `<head>`.
16
17
The main advantage of placing it in the `<head>` is that you will track the
18
user's `pageview` even if they leave the page before it has been fully loaded.
19
20
Here's a handy quote from [Mathias Bynens](https://mathiasbynens.be/notes/async-analytics-snippet#comment-50) about our placement choice.
21
>I should point out that it’s Google — not me — recommending to place this
22
script before all other scripts in the document. The only real advantage is to
23
catch a pageView call if your page fails to load completely (for example, if
24
the user aborts loading, or quickly closes the page, etc.). Personally, I
25
wouldn’t count that as a page view, so I actually prefer to place this script
26
at the bottom, after all other scripts. This keeps all the scripts together and
27
reinforces that scripts at the bottom are the right move. (Usually I
28
concatenate and minify all my scripts into one .js file — the GA snippet being
29
the suffix.)
30
31
### Do I need to upgrade my site each time a new version of HTML5 Boilerplate is released?
32
33
No, just as you don't normally replace the foundation of a house once it
34
was built. However, there is nothing stopping you from trying to work in the
35
latest changes, but you'll have to assess the costs/benefits of doing so.
36
37
### Where can I get help with support questions?
38
39
Please ask for help on
40
[StackOverflow](https://stackoverflow.com/questions/tagged/html5boilerplate).
You can’t perform that action at this time.