@@ -31,13 +31,11 @@ export function GoogleAnalyticsProvider({ children }: { children: React.ReactNod
3131 personalization_storage : "denied" ,
3232 security_storage : "granted" , // Always granted for security
3333 wait_for_update : 2000 , // Wait up to 2 seconds for consent update
34+ // Enable cookieless pings for conversion measurement
35+ url_passthrough : true , // Pass click information via URL parameters
36+ ads_data_redaction : true , // Redact ads data when consent is denied
3437 } )
3538
36- // Enable cookieless pings for conversion measurement
37- // These must be set separately with gtag 'set' command
38- window . gtag ( "set" , "ads_data_redaction" , true ) // Redact ads data when consent is denied
39- window . gtag ( "set" , "url_passthrough" , true ) // Pass click information via URL parameters
40-
4139 // Check initial consent status and update if already consented
4240 if ( hasConsent ( ) ) {
4341 updateConsentState ( true )
@@ -84,10 +82,12 @@ export function GoogleAnalyticsProvider({ children }: { children: React.ReactNod
8482 />
8583 < Script id = "google-ads-config" strategy = "afterInteractive" >
8684 { `
85+ gtag('js', new Date());
86+
8787 // Configure Google Ads with enhanced measurement
8888 gtag('config', '${ GADS_ID } ', {
89- allow_google_signals: false, // Disable by default, enabled when consent granted
90- allow_ad_personalization_signals: false, // Disable by default
89+ allow_google_signals: false,
90+ allow_ad_personalization_signals: false,
9191 // Enable enhanced conversions for better measurement
9292 enhanced_conversions: {
9393 automatic: true
0 commit comments