We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b863dee commit aac2fa5Copy full SHA for aac2fa5
docs/.vitepress/theme/index.ts
@@ -33,6 +33,16 @@ function initGoogleAnalytics() {
33
window.gtag = function (...args: unknown[]) {
34
window.dataLayer!.push(args);
35
};
36
+
37
+ // Set default consent - required for GA4 to send data
38
+ // This grants analytics by default (no ads tracking)
39
+ window.gtag("consent", "default", {
40
+ analytics_storage: "granted",
41
+ ad_storage: "denied",
42
+ ad_user_data: "denied",
43
+ ad_personalization: "denied",
44
+ });
45
46
window.gtag("js", new Date());
47
// Disable automatic page_view - we send manually to track SPA navigation
48
window.gtag("config", GA_ID, { send_page_view: false });
0 commit comments