From e8808d252c0454c0bd114bd7ba38123ec27a7a8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20J=2E=20Hurtado=20Ruesga?= Date: Sun, 1 Nov 2020 13:09:04 +0100 Subject: [PATCH] Add support for Google gtags (Google Analytics v4) --- README.md | 3 +++ _layouts/default.html | 13 +++++++++++++ 2 files changed, 16 insertions(+) diff --git a/README.md b/README.md index 424e109..51a05ff 100644 --- a/README.md +++ b/README.md @@ -38,8 +38,11 @@ Additionally, you may choose to set the following optional variables: ```yml show_downloads: ["true" or "false" to indicate whether to provide a download URL] google_analytics: [Your Google Analytics tracking ID] +google_analytics_v4: [Your Google Analytics v4 (gtags) tracking ID] ``` +`google_analytics` and `google_analytics_v4` are incompatible, you have to choose one of them, if both are set the later takes precedence. + ### Stylesheet If you'd like to add your own custom styles: diff --git a/_layouts/default.html b/_layouts/default.html index aa65198..d749bbb 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -1,6 +1,17 @@ + {% if site.google_analytics_v4 %} + + + + {% endif %} @@ -35,6 +46,7 @@ {% if site.google_analytics %} + {% unless site.google_analytics_v4 %} + {% endunless %} {% endif %}