From 958f227d39308747bf04ea368da8edd6474a3620 Mon Sep 17 00:00:00 2001 From: Alex Skrenchuk Date: Thu, 22 Jun 2023 22:06:27 -0700 Subject: [PATCH] Refactor google analytics: - move google analytics code into analytics.html file in includes - change config variable from google_analytics_key to googe_analytics_id - replace analytics.js with gtag.js --- _config.yml | 6 +----- _includes/analytics.html | 9 +++++++++ _layouts/default.html | 11 +++-------- 3 files changed, 13 insertions(+), 13 deletions(-) create mode 100644 _includes/analytics.html diff --git a/_config.yml b/_config.yml index c1d3d47..3e29a79 100644 --- a/_config.yml +++ b/_config.yml @@ -6,7 +6,7 @@ url: "https://ontoportal.org" virtual_appliance_url: "https://ontoportal.github.io/documentation/administration/steps/getting_started" demo_url: "https://demo.ontoportal.org" baseurl: '' -google_analytics_key: +google_analytics_id: G-K28QEN0HVL google_maps_javascript_api_key: disqus_shortname: support_mail: "support@ontoportal.org" @@ -207,7 +207,3 @@ _comments: highlight: Emphasis the text color: The background colour used in the plan name and call to action. new_window: Open link in new window - - # Google Analytics - ga_tracking: G-40129Q9CS5 - ga_tracking_anonymize_ip: true # Use GDPR compliant Google Analytics settings (true by default) diff --git a/_includes/analytics.html b/_includes/analytics.html new file mode 100644 index 0000000..2fc4361 --- /dev/null +++ b/_includes/analytics.html @@ -0,0 +1,9 @@ + + + diff --git a/_layouts/default.html b/_layouts/default.html index 8faee5e..dd927f7 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -7,19 +7,14 @@ {% seo %} {% feed_meta %} + {% if jekyll.environment == 'production' and site.google_analytics_id %} + {% include analytics.html %} + {% endif %} - {% if jekyll.environment == 'production' and site.google_analytics_key != '' %} - - - {% endif %}