Skip to content

Commit

Permalink
Revert "Upgrade from analytics.js to gtag.js."
Browse files Browse the repository at this point in the history
This reverts commit c71d853.
  • Loading branch information
sjparkinson committed Jun 21, 2018
1 parent a1733bb commit d2f951c
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,6 @@
<meta name="theme-color" content="#157878">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<link rel="stylesheet" href="{{ '/assets/css/style.css?v=' | append: site.github.build_revision | relative_url }}">

{% if site.google_analytics %}
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '{{ site.google_analytics }}');
</script>
{% endif %}
</head>
<body>
<a id="skip-to-content" href="#content">Skip to the content.</a>
Expand All @@ -44,5 +34,17 @@ <h2 class="project-tagline">{{ site.description | default: site.github.project_t
<span class="site-footer-credits">This page was generated by <a href="https://pages.github.com">GitHub Pages</a>.</span>
</footer>
</main>

{% if site.google_analytics %}
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', '{{ site.google_analytics }}', 'auto');
ga('send', 'pageview');
</script>
{% endif %}
</body>
</html>

0 comments on commit d2f951c

Please sign in to comment.