From 271d9c4bc2c1d6b9db66cc09ba6a6ae5b2171bf2 Mon Sep 17 00:00:00 2001 From: Khuyen Tran Date: Thu, 16 Apr 2026 10:05:52 +0700 Subject: [PATCH 1/2] feat(docs): add GA4 tracking with GDPR cookie consent banner --- .../layouts/partials/docs/inject/head.html | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/docs/site/layouts/partials/docs/inject/head.html b/docs/site/layouts/partials/docs/inject/head.html index 3c04b44..cb55a52 100644 --- a/docs/site/layouts/partials/docs/inject/head.html +++ b/docs/site/layouts/partials/docs/inject/head.html @@ -1,2 +1,71 @@ + + + + + + + From 016292207415336f8343e1ff497c73ebb2e73991 Mon Sep 17 00:00:00 2001 From: Khuyen Tran Date: Thu, 16 Apr 2026 10:16:01 +0700 Subject: [PATCH 2/2] fix(docs): init cookie consent on DOMContentLoaded --- docs/site/layouts/partials/docs/inject/head.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/site/layouts/partials/docs/inject/head.html b/docs/site/layouts/partials/docs/inject/head.html index cb55a52..73b787e 100644 --- a/docs/site/layouts/partials/docs/inject/head.html +++ b/docs/site/layouts/partials/docs/inject/head.html @@ -30,7 +30,7 @@ }]); }; - CookieConsent.run({ + window.addEventListener('DOMContentLoaded', () => CookieConsent.run({ guiOptions: { consentModal: { layout: 'box', position: 'bottom right' }, preferencesModal: { layout: 'box' }, @@ -67,5 +67,5 @@ onFirstConsent: () => updateGtag(CookieConsent.acceptedCategory('analytics')), onChange: () => updateGtag(CookieConsent.acceptedCategory('analytics')), onConsent: () => updateGtag(CookieConsent.acceptedCategory('analytics')), - }); + }));