Skip to content

Commit

Permalink
Minima Doesn't support GA4 (per
Browse files Browse the repository at this point in the history
[O[Ihttps://github.com/jekyll/minima/issues/561)

So I've put the relevent GA4 in an included head.html file.
  • Loading branch information
joereddington committed Aug 25, 2021
1 parent 61fafcb commit c66865f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
1 change: 0 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ description: >- # this means to ignore newlines until "baseurl:"
baseurl:
url: http://www.projectreal.co.uk/
github_username: equalitytime
google_analytics: G-M3S13W23GW

# Build settings
theme: minima
Expand Down
20 changes: 20 additions & 0 deletions _includes/head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-M3S13W23GW"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'G-M3S13W23GW');
</script>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
{%- seo -%}
<link rel="stylesheet" href="{{ "/assets/main.css" | relative_url }}">
{%- feed_meta -%}
{%- if jekyll.environment == 'production' and site.google_analytics -%}
{%- include google-analytics.html -%}
{%- endif -%}
</head>

0 comments on commit c66865f

Please sign in to comment.