mirror of
git://f0xx.org/ac/ac-platform-web
synced 2026-07-29 04:18:31 +03:00
fix(analytics): do not load GA4 until cookie consent is "all"
Previously gtag could load on first visit (no choice yet) or after partial consent, pulling googletagmanager.com and triggering broken-HTTPS warnings when that CDN hit cert errors on the client path. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -19,10 +19,7 @@
|
||||
|
||||
function enabled() {
|
||||
if (global.AndroidCastCookieConsent && !global.AndroidCastCookieConsent.allowsAnalytics()) {
|
||||
var choice = global.AndroidCastCookieConsent.getChoice && global.AndroidCastCookieConsent.getChoice();
|
||||
if (choice && choice !== 'all') {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return measurementId.length > 0 && /^G-[A-Z0-9]+$/i.test(measurementId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user