From a18ec0422743e6fe6f35ffb18694054dae09a6f1 Mon Sep 17 00:00:00 2001 From: Tudor Date: Mon, 12 Jan 2026 09:10:36 +0000 Subject: [PATCH] fixing GA implementation race condition for account id retrieval --- frontend/index.html | 40 +++++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/frontend/index.html b/frontend/index.html index 62b1d38..7ebaba4 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -140,10 +140,9 @@
@@ -358,32 +357,39 @@ @@ -415,6 +421,14 @@ }, onConsentChange: function(consent) { if (consent.analytics) { + analyticsConsentGiven = true; + loadGoogleAnalytics(); + } + }, + onReady: function(consent) { + // Called on page load with existing consent state + if (consent && consent.analytics) { + analyticsConsentGiven = true; loadGoogleAnalytics(); } }