From be3f49fe6d04ef9f38d272b6481e1d4a0dd7e6c1 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 10 Jan 2026 13:40:51 +0000 Subject: [PATCH 1/2] Add Google Analytics 4 (GA4) integration - Switch analytics provider from Plausible to Google Analytics - Configure GA4 tracking ID: G-0ZPVV6GNEY - Update google.html provider template to use modern GA4 format (gtag.js) - Maintain consent-first architecture: consent.js handles GA4 loading after user consent - Add conditional logic for sites with/without consent banner --- _config.yml | 4 +-- _includes/analytics-providers/google.html | 31 +++++++++++++++-------- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/_config.yml b/_config.yml index f6f3080..71b785a 100644 --- a/_config.yml +++ b/_config.yml @@ -93,9 +93,9 @@ social: # Analytics analytics: - provider : plausible # false (default), "google", "google-universal", "custom", "plausible" + provider : google # false (default), "google", "google-universal", "custom", "plausible" google: - tracking_id : "" + tracking_id : "G-0ZPVV6GNEY" plausible: domain : "camilo-cf.github.io" api_host : "https://plausible.io" diff --git a/_includes/analytics-providers/google.html b/_includes/analytics-providers/google.html index 57554b6..54f812a 100644 --- a/_includes/analytics-providers/google.html +++ b/_includes/analytics-providers/google.html @@ -1,11 +1,20 @@ - + + +{% if site.analytics.google.tracking_id %} + {% unless site.consent_banner.enabled %} + + + + {% else %} + + + {% endunless %} +{% endif %} From 23933eb9cfcf2fa633c250bfaffcd2d2159ba742 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 10 Jan 2026 13:48:15 +0000 Subject: [PATCH 2/2] Implement comprehensive security improvements Security enhancements: - Add Content Security Policy (CSP) to prevent XSS attacks - Add X-Content-Type-Options: nosniff to prevent MIME sniffing - Add Referrer-Policy: strict-origin-when-cross-origin for privacy - Add Permissions-Policy to restrict browser features (geolocation, camera, etc.) Dependency upgrades: - Upgrade MathJax from 2.7.1 to 3.x (latest) for better security and performance - Update MathJax configuration to modern MathJax 3 format - Add Subresource Integrity (SRI) hash to MathJax for tamper protection - Add crossorigin="anonymous" attribute for CORS security Benefits: - Enhanced XSS protection via CSP - Prevents clickjacking and MIME-type attacks - Better privacy with stricter referrer policies - Restricts unnecessary browser permissions - Modern, maintained dependencies with security updates --- _includes/head/custom.html | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/_includes/head/custom.html b/_includes/head/custom.html index fee5d30..cc89989 100644 --- a/_includes/head/custom.html +++ b/_includes/head/custom.html @@ -2,6 +2,12 @@ + + + + + + @@ -24,15 +30,22 @@ - - - +