Removes GA references from dist

This commit is contained in:
Rob Larsen
2021-10-28 13:27:13 -04:00
parent 748ead7798
commit a1bf10c196
2 changed files with 0 additions and 100 deletions

68
dist/doc/extend.md vendored
View File

@@ -9,7 +9,6 @@ everything fits with everyone's needs.
* [App Stores](#app-stores)
* [DNS prefetching](#dns-prefetching)
* [Google Universal Analytics](#google-universal-analytics)
* [Internet Explorer](#internet-explorer)
* [Miscellaneous](#miscellaneous)
* [News Feeds](#news-feeds)
@@ -79,73 +78,6 @@ on them ASAP.
* https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-DNS-Prefetch-Control
* https://dev.chromium.org/developers/design-documents/dns-prefetching
## Google Universal Analytics
### More tracking settings
The [optimized Google Universal Analytics
snippet](https://mathiasbynens.be/notes/async-analytics-snippet#universal-analytics)
included with HTML5 Boilerplate includes something like this:
```js
ga('create', 'UA-XXXXX-X', 'auto'); ga('send', 'pageview');
```
To customize further, see Google's [Advanced
Setup](https://developers.google.com/analytics/devguides/collection/analyticsjs/),
[Pageview](https://developers.google.com/analytics/devguides/collection/analyticsjs/pages),
and
[Event](https://developers.google.com/analytics/devguides/collection/analyticsjs/events)
Docs.
### Track JavaScript errors in Google Analytics
Add this function after `ga` is defined:
```js
(function(window){
var undefined,
link = function (href) {
var a = window.document.createElement('a');
a.href = href;
return a;
};
window.onerror = function (message, file, line, column) {
var host = link(file).hostname;
ga('send', {
'hitType': 'event',
'eventCategory': (host == window.location.hostname || host == undefined || host == '' ? '' : 'external ') + 'error',
'eventAction': message,
'eventLabel': (file + ' LINE: ' + line + (column ? ' COLUMN: ' + column : '')).trim(),
'nonInteraction': 1
});
};
}(window));
```
### Track page scroll
Add this function after `ga` is defined. Note, the following snippet requires jQuery.
```js
$(function(){
var isDuplicateScrollEvent,
scrollTimeStart = new Date,
$window = $(window),
$document = $(document),
scrollPercent;
$window.scroll(function() {
scrollPercent = Math.round(100 * ($window.height() + $window.scrollTop())/$document.height());
if (scrollPercent > 90 && !isDuplicateScrollEvent) { //page scrolled to 90%
isDuplicateScrollEvent = 1;
ga('send', 'event', 'scroll',
'Window: ' + $window.height() + 'px; Document: ' + $document.height() + 'px; Time: ' + Math.round((new Date - scrollTimeStart )/1000,1) + 's'
);
}
});
});
```
## Internet Explorer

32
dist/doc/faq.md vendored
View File

@@ -3,40 +3,8 @@ table of contents](TOC.md)
# Frequently asked questions
* [Why is the Google Analytics code at the bottom? Google recommends it be
placed in the
`<head>`.](#why-is-the-google-analytics-code-at-the-bottom-google-recommends-it-be-placed-in-the-head)
* [Do I need to upgrade my site each time a new version of HTML5 Boilerplate is
released?](#do-i-need-to-upgrade-my-site-each-time-a-new-version-of-html5-boilerplate-is-released)
* [Where can I get help with support
questions?](#where-can-i-get-help-with-support-questions)
---
## Why is the Google Analytics code at the bottom? Google recommends it be placed in the `<head>`.
The main advantage of placing it in the `<head>` is that you will track the
user's `pageview` even if they leave the page before it has been fully loaded.
Here's a handy quote from [Mathias
Bynens](https://mathiasbynens.be/notes/async-analytics-snippet#comment-50) about
our placement choice.
>I should point out that its Google — not me — recommending to place this
script before all other scripts in the document. The only real advantage is to
catch a pageView call if your page fails to load completely (for example, if the
user aborts loading, or quickly closes the page, etc.). Personally, I wouldnt
count that as a page view, so I actually prefer to place this script at the
bottom, after all other scripts. This keeps all the scripts together and
reinforces that scripts at the bottom are the right move. (Usually I concatenate
and minify all my scripts into one .js file — the GA snippet being the suffix.)
## Do I need to upgrade my site each time a new version of HTML5 Boilerplate is released?
No, just as you don't normally replace the foundation of a house once it was
built. However, there is nothing stopping you from trying to work in the latest
changes, but you'll have to assess the costs/benefits of doing so.
## Where can I get help with support questions?
Please ask for help on
[StackOverflow](https://stackoverflow.com/questions/tagged/html5boilerplate).