Skip to content
This repository was archived by the owner on Jan 8, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions content/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<html class="no-js" lang="en-US" prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb#">
<head>
{{ partial "head.html" . }}
{{ partial "analytics.html" . }}
</head>
<body lang="en" class="open-sans ipld-gray bg-white">
{{ partial "topbar.html" . }}
Expand Down
58 changes: 58 additions & 0 deletions layouts/partials/analytics.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<!-- Google Analytics -->
<script>
/* https://github.com/schalkneethling/dnt-helper/blob/master/js/dnt-helper.js
*/
function _dntEnabled(dnt, userAgent) {
"use strict";
var dntStatus =
dnt ||
navigator.doNotTrack ||
window.doNotTrack ||
navigator.msDoNotTrack;
var ua = userAgent || navigator.userAgent;
var anomalousWinVersions = [
"Windows NT 6.1",
"Windows NT 6.2",
"Windows NT 6.3"
];
var fxMatch = ua.match(/Firefox\/(\d+)/);
var ieRegEx = /MSIE|Trident/i;
var isIE = ieRegEx.test(ua);
var platform = ua.match(/Windows.+?(?=;)/g);
if (isIE && typeof Array.prototype.indexOf !== "function") {
return false;
} else if (fxMatch && parseInt(fxMatch[1], 10) < 32) {
dntStatus = "Unspecified";
} else if (
isIE &&
platform &&
anomalousWinVersions.indexOf(platform.toString()) !== -1
) {
dntStatus = "Unspecified";
} else {
dntStatus =
{ "0": "Disabled", "1": "Enabled" }[dntStatus] || "Unspecified";
}
return dntStatus === "Enabled";
}
(function() {
if (!_dntEnabled() && location.hostname !== "localhost") {
!(function(n, o, d, e, j, s) {
n.GoogleAnalyticsObject = d;
n[d] ||
(n[d] = function() {
(n[d].q = n[d].q || []).push(arguments);
});
n[d].l = +new Date();
j = o.createElement(e);
s = o.getElementsByTagName(e)[0];
j.async = 1;
j.src = "//www.google-analytics.com/analytics.js";
s.parentNode.insertBefore(j, s);
})(window, document, "ga", "script");
if (!ga) return;
ga("create", "UA-96910779-9", "auto");
ga("send", "pageview");
}
})();
</script>