Skip to content

Commit

Permalink
Add gtag
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisglein committed Jan 14, 2024
1 parent 97ffe3b commit 1cf3f47
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
1 change: 0 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ description: 'Game design, and musings on life in general'
baseurl: /
url: https://chrisglein.com
paginate: 5
google_analytics_id: G-G00GHWLPKL

# About/contact
author:
Expand Down
16 changes: 7 additions & 9 deletions _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,12 @@

<link rel="alternate" type="application/rss+xml" title="RSS" href="{{ '/atom.xml' | absolute_url }}">

{% if site.google_analytics_id %}
<script async src="https://www.googletagmanager.com/gtag/js?id=G-G00GHWLPKL"></script>
<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_id }}', 'auto');
ga('send', 'pageview');
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'G-G00GHWLPKL');
</script>
{% endif %}
</head>
</head>

0 comments on commit 1cf3f47

Please sign in to comment.