Skip to content

Commit 276d1ff

Browse files
committed
fix: Enable Google Ads conversion tracking with consent mode
This fixes two critical issues preventing Google Ads conversions from being tracked: 1. Removed wait_for_update parameter that was blocking all conversion pings - Previously, gtag waited 500ms for consent updates then dropped all events - Now sends cookieless conversion pings immediately when consent is denied 2. Re-initialize gtag config after consent is granted - When users accept cookies, gtag('config') is now called to flush queued events - This enables full conversion tracking with user data after consent With these changes: - WITHOUT consent: Anonymized conversion pings are sent for Google's conversion modeling - WITH consent: Full conversion tracking with user data is enabled Fixes the issue where window.gtag() executed but sent no network requests.
1 parent 8e4b145 commit 276d1ff

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

apps/web-roo-code/src/components/providers/google-analytics-provider.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ export function GoogleAnalyticsProvider({ children }: { children: React.ReactNod
5757
functionality_storage: "denied",
5858
personalization_storage: "denied",
5959
security_storage: "granted", // Always granted for security
60-
wait_for_update: 500, // Wait 500ms for consent before sending data
6160
})
6261

6362
// Enable cookieless pings for Google Ads
@@ -76,6 +75,9 @@ export function GoogleAnalyticsProvider({ children }: { children: React.ReactNod
7675
functionality_storage: "granted",
7776
personalization_storage: "granted",
7877
})
78+
79+
// Re-initialize config to flush queued events and enable tracking
80+
window.gtag("config", GTM_ID)
7981
}
8082
}
8183

0 commit comments

Comments
 (0)