From 6c49168d7f7f7af7dacc432f7c0670ffb3760d8b Mon Sep 17 00:00:00 2001 From: paul Date: Sat, 6 Feb 2021 12:02:54 +0000 Subject: [PATCH] Add Google Analytics GA4 code (Issue #45) --- _config.yml | 3 +++ _includes/analytics_head.html | 9 +++++++++ _layouts/default.html | 1 + 3 files changed, 13 insertions(+) create mode 100644 _includes/analytics_head.html diff --git a/_config.yml b/_config.yml index 1a7bbf1..b3adfbf 100644 --- a/_config.yml +++ b/_config.yml @@ -43,6 +43,9 @@ disqus: # Enter your Google Analytics web tracking code (e.g. UA-2110908-2) to activate tracking google_analytics: UA-43339302-11 +# For newer "GA4" analytics, use the following instead of the "UA" entry above +#google_analytics_ga4: G-GABC1DEFG + # Your website URL (e.g. http://amitmerchant1990.github.io or http://www.amitmerchant.com) # Used for Sitemap.xml and your RSS feed url: http://www.amitmerchant.com/reverie diff --git a/_includes/analytics_head.html b/_includes/analytics_head.html new file mode 100644 index 0000000..d077ff8 --- /dev/null +++ b/_includes/analytics_head.html @@ -0,0 +1,9 @@ +{% if site.google_analytics_ga4 %} + + +{% endif %} diff --git a/_layouts/default.html b/_layouts/default.html index afac3ec..34a888c 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -11,6 +11,7 @@ + {% include analytics_head.html %}