@bigz-app/booking-widget 0.3.2 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"BookingSuccessModal.d.ts","sourceRoot":"","sources":["../../src/components/BookingSuccessModal.tsx"],"names":[],"mappings":"AAeA,UAAU,wBAAwB;IACjC,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,EAAE,GAAG,CAAC;IACZ,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED,eAAO,MAAM,mBAAmB,GAAI,wDAMjC,wBAAwB,mDAywB1B,CAAC"}
1
+ {"version":3,"file":"BookingSuccessModal.d.ts","sourceRoot":"","sources":["../../src/components/BookingSuccessModal.tsx"],"names":[],"mappings":"AAYA,UAAU,wBAAwB;IACjC,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,EAAE,GAAG,CAAC;IACZ,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED,eAAO,MAAM,mBAAmB,GAAI,wDAMjC,wBAAwB,mDAqwB1B,CAAC"}
@@ -114,25 +114,11 @@ export interface UniversalBookingConfig {
114
114
  buttonText?: string;
115
115
  locale?: string;
116
116
  googleAds?: {
117
- /**
118
- * Google Ads Tag ID (e.g., 'AW-XXXXXXX')
119
- * If not provided, no conversion tracking will be performed
120
- */
121
117
  tagId?: string;
122
- /**
123
- * Google Ads Conversion ID/Label (e.g., 'booking_conversion')
124
- * If not provided, no conversion tracking will be performed
125
- */
126
118
  conversionId?: string;
127
- /**
128
- * Optional conversion currency (defaults to 'EUR')
129
- */
130
119
  conversionCurrency?: string;
131
- /**
132
- * Whether to include the booking value as conversion value (default: true)
133
- * If false, no conversion value will be sent
134
- */
135
120
  includeValue?: boolean;
121
+ consent?: boolean;
136
122
  };
137
123
  onSuccess?: (result: any) => void;
138
124
  onError?: (error: string) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"UniversalBookingWidget.d.ts","sourceRoot":"","sources":["../../src/components/UniversalBookingWidget.tsx"],"names":[],"mappings":"AAmBA,MAAM,WAAW,SAAS;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE;QACT,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;KACd,CAAC;IACF,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,eAAe,EAAE,MAAM,CAAC;IACxB,uBAAuB,EAAE,MAAM,CAAC;IAChC,qBAAqB,EAAE,OAAO,CAAC;CAC/B;AAED,MAAM,WAAW,aAAa;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY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AK,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IACF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IAGpB,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAGhB,SAAS,CAAC,EAAE;QACX;;;WAGG;QACH,KAAK,CAAC,EAAE,MAAM,CAAC;QAEf;;;WAGG;QACH,YAAY,CAAC,EAAE,MAAM,CAAC;QAEtB;;WAEG;QACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAE5B;;;WAGG;QACH,YAAY,CAAC,EAAE,OAAO,CAAC;KACvB,CAAC;IAGF,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,CAAC;IAClC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAClC;AAKD,wBAAgB,sBAAsB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE;IAAE,MAAM,EAAE,sBAAsB,CAAA;CAAE,2CA88BhG"}
1
+ {"version":3,"file":"UniversalBookingWidget.d.ts","sourceRoot":"","sources":["../../src/components/UniversalBookingWidget.tsx"],"names":[],"mappings":"AAmBA,MAAM,WAAW,SAAS;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE;QACT,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;KACd,CAAC;IACF,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAA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"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,wBAAgB,YAAY,CAAC,EAC5B,QAAQ,EACR,MAAM,EACN,MAAe,GACf,EAAE;IACF,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB,4BA+GA;AAGD,wBAAgB,aAAa,CAAC,EAC7B,MAAM,EACN,OAAO,EACP,QAAQ,EACR,QAAkB,EAClB,SAAS,EACT,MAAe,GACf,EAAE;IACF,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB,kDAoIA"}
1
+ {"version":3,"file":"DialogPortal.d.ts","sourceRoot":"","sources":["../../../src/components/shared/DialogPortal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,wBAAgB,YAAY,CAAC,EAC5B,QAAQ,EACR,MAAM,EACN,MAAe,GACf,EAAE;IACF,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB,4BA8GA;AAGD,wBAAgB,aAAa,CAAC,EAC7B,MAAM,EACN,OAAO,EACP,QAAQ,EACR,QAAkB,EAClB,SAAS,EACT,MAAe,GACf,EAAE;IACF,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB,kDAoIA"}
package/dist/index.cjs CHANGED
@@ -257,7 +257,7 @@ const resolveSemanticColor = (colorValue, fallbackValue) => {
257
257
  const themes = {
258
258
  // --- Light Themes ---
259
259
  "light-fresh": {
260
- highlight: "#00a8a1", // accent-strong
260
+ highlight: "#00b1aa", // accent-strong
261
261
  background: "#f8fdfe", // neutral-strong (background)
262
262
  surface: "#ffffff", // card (pure white)
263
263
  text: "#0e7490", // Turquoise 800
@@ -6801,7 +6801,6 @@ function DialogPortal({ children, isOpen, zIndex = 999999, }) {
6801
6801
  }
6802
6802
  catch (error) {
6803
6803
  // Ignore removal errors - element may have already been removed
6804
- console.debug("Portal cleanup: Element already removed");
6805
6804
  }
6806
6805
  }
6807
6806
  document.body.style.overflow = "";
@@ -10295,312 +10294,116 @@ function BookingForm({ config, eventDetails, stripePromise, onSuccess, onError,
10295
10294
  /**
10296
10295
  * Google Ads Conversion Tracking Utility
10297
10296
  *
10298
- * This utility handles Google Ads conversion tracking for the booking widget.
10299
- * It includes consent checking, gtag initialization, and conversion tracking.
10297
+ * Simplified utility that waits 1500ms, checks/initializes gtag, and sends conversion.
10300
10298
  */
10301
10299
  /**
10302
- * Check if Google Consent Mode has granted the necessary permissions for ads tracking
10303
- * This checks multiple sources of consent state in order of preference
10300
+ * Check if gtag is available in current or parent window
10304
10301
  */
10305
- function checkGoogleConsent() {
10306
- console.log("[Google Ads Tracking] 🔍 Checking Google consent...");
10302
+ function isGtagAvailable() {
10307
10303
  if (typeof window === "undefined") {
10308
- console.log("[Google Ads Tracking] ❌ Window object not available (SSR context)");
10309
10304
  return false;
10310
10305
  }
10311
- console.log("[Google Ads Tracking] ✅ Window object available");
10312
- // Method 1: Check dataLayer for consent_update events (most reliable)
10313
- if (window.dataLayer && Array.isArray(window.dataLayer)) {
10314
- console.log("[Google Ads Tracking] 🔍 Checking dataLayer for consent events...");
10315
- const dataLayer = window.dataLayer;
10316
- // Debug: Show the entire dataLayer contents
10317
- console.log("[Google Ads Tracking] 🗂️ Complete dataLayer contents:", JSON.stringify(dataLayer, null, 2));
10318
- console.log("[Google Ads Tracking] 📊 dataLayer length:", dataLayer.length);
10319
- // Look for the most recent consent update in dataLayer
10320
- let latestConsentState = null;
10321
- const foundEvents = [];
10322
- // Search backwards through dataLayer for most recent consent state
10323
- for (let i = dataLayer.length - 1; i >= 0; i--) {
10324
- const event = dataLayer[i];
10325
- console.log(`[Google Ads Tracking] 🔍 Checking dataLayer[${i}]:`, event);
10326
- if (event && typeof event === "object") {
10327
- // Check for various consent event patterns
10328
- if (event.event === "consent_update" || event.event === "default_consent") {
10329
- console.log("[Google Ads Tracking] 📋 Found consent event:", event);
10330
- foundEvents.push(event);
10331
- if (event.consent_mode) {
10332
- latestConsentState = event.consent_mode;
10333
- break;
10334
- }
10335
- }
10336
- // Also check for direct consent_mode properties
10337
- if (event.consent_mode) {
10338
- console.log("[Google Ads Tracking] 📋 Found consent_mode property:", event);
10339
- foundEvents.push(event);
10340
- latestConsentState = event.consent_mode;
10341
- break;
10342
- }
10306
+ // Check current window
10307
+ if (typeof window.gtag === "function") {
10308
+ return true;
10309
+ }
10310
+ // Check parent window (for iframe/widget scenarios)
10311
+ if (window !== window.parent) {
10312
+ try {
10313
+ if (typeof window.parent?.gtag === "function") {
10314
+ return true;
10343
10315
  }
10344
10316
  }
10345
- console.log("[Google Ads Tracking] 📋 All found consent events:", foundEvents);
10346
- if (latestConsentState) {
10347
- const adStorageGranted = latestConsentState.ad_storage === "granted";
10348
- console.log("[Google Ads Tracking] 🔐 ad_storage from dataLayer:", latestConsentState.ad_storage);
10349
- console.log("[Google Ads Tracking] 🎯 Consent result from dataLayer:", adStorageGranted);
10350
- return adStorageGranted;
10317
+ catch (e) {
10318
+ // Cannot access parent window (cross-origin)
10351
10319
  }
10352
- console.log("[Google Ads Tracking] ❌ No consent events found in dataLayer");
10353
- }
10354
- console.log("[Google Ads Tracking] ❌ dataLayer not found or not an array");
10355
- // Method 2: Check for cookie-based consent (fallback for host implementation)
10356
- console.log("[Google Ads Tracking] 🔍 Checking cookie-based consent...");
10357
- try {
10358
- // Debug: Show all cookies
10359
- console.log("[Google Ads Tracking] 🍪 All cookies:", document.cookie);
10360
- const allCookies = document.cookie.split(";").map((cookie) => cookie.trim());
10361
- console.log("[Google Ads Tracking] 🍪 Parsed cookies:", allCookies);
10362
- // Check for the host page's conversion tracking consent cookie
10363
- const conversionTrackingCookie = document.cookie
10364
- .split(";")
10365
- .find((cookie) => cookie.trim().startsWith("conversionTrackingConsent="));
10366
- if (conversionTrackingCookie) {
10367
- const cookieValue = conversionTrackingCookie.split("=")[1];
10368
- const isGranted = cookieValue === "true";
10369
- console.log("[Google Ads Tracking] 🍪 Found conversionTrackingConsent cookie:", cookieValue);
10370
- console.log("[Google Ads Tracking] 🎯 Consent result from cookie:", isGranted);
10371
- return isGranted;
10372
- }
10373
- console.log("[Google Ads Tracking] ❌ conversionTrackingConsent cookie not found");
10374
- // Also check for other potential cookie names
10375
- const alternativeCookieNames = ["analyticsConsent", "ads_consent", "ad_storage"];
10376
- for (const cookieName of alternativeCookieNames) {
10377
- const alternativeCookie = allCookies.find((cookie) => cookie.startsWith(`${cookieName}=`));
10378
- if (alternativeCookie) {
10379
- console.log(`[Google Ads Tracking] 🍪 Found alternative cookie ${cookieName}:`, alternativeCookie);
10380
- }
10381
- }
10382
- }
10383
- catch (error) {
10384
- console.warn("[Google Ads Tracking] ⚠️ Error checking cookies:", error);
10385
- }
10386
- // Method 3: Check if gtag exists but no consent state found
10387
- if (typeof window.gtag === "function") {
10388
- console.log("[Google Ads Tracking] ⚠️ gtag function exists but no consent state found");
10389
- console.log("[Google Ads Tracking] 💡 This might indicate consent hasn't been set yet");
10390
- }
10391
- else {
10392
- console.log("[Google Ads Tracking] ❌ gtag function not found");
10393
10320
  }
10394
- // If no consent mechanism is found, assume consent is not granted
10395
- console.log("[Google Ads Tracking] 🚫 No valid consent state found, returning false");
10396
10321
  return false;
10397
10322
  }
10398
10323
  /**
10399
- * Check if gtag is already initialized on the host page
10324
+ * Initialize gtag if not already available
10400
10325
  */
10401
- function isGtagInitialized() {
10402
- console.log("[Google Ads Tracking] 🔍 Checking if gtag is initialized...");
10326
+ function initializeGtag(tagId) {
10403
10327
  if (typeof window === "undefined") {
10404
- console.log("[Google Ads Tracking] ❌ Window object not available (SSR context)");
10405
- return false;
10328
+ return;
10406
10329
  }
10407
- console.log("[Google Ads Tracking] Window object available");
10408
- // Check if gtag function exists
10409
- if (typeof window.gtag === "function") {
10410
- console.log("[Google Ads Tracking] ✅ gtag function exists");
10411
- return true;
10330
+ // Skip if gtag already exists
10331
+ if (isGtagAvailable()) {
10332
+ return;
10412
10333
  }
10413
- console.log("[Google Ads Tracking] gtag function not found, checking for scripts...");
10414
- // Check if Google Analytics or Google Ads scripts are already loaded
10415
- const scripts = document.querySelectorAll('script[src*="googletagmanager.com"]');
10416
- console.log("[Google Ads Tracking] 📜 Found", scripts.length, "Google Tag Manager scripts");
10417
- const isInitialized = scripts.length > 0;
10418
- console.log("[Google Ads Tracking] 🎯 gtag initialization status:", isInitialized);
10419
- return isInitialized;
10420
- }
10421
- /**
10422
- * Initialize Google Tag (gtag) if not already present
10423
- */
10424
- function initializeGtag(tagId) {
10425
- console.log("[Google Ads Tracking] 🚀 Starting gtag initialization with tagId:", tagId);
10426
- return new Promise((resolve, reject) => {
10427
- if (typeof window === "undefined") {
10428
- console.log("[Google Ads Tracking] ❌ Window object not available (SSR context)");
10429
- reject(new Error("Window object not available"));
10430
- return;
10431
- }
10432
- console.log("[Google Ads Tracking] ✅ Window object available");
10433
- // If gtag is already initialized, just resolve
10434
- if (isGtagInitialized()) {
10435
- console.log("[Google Ads Tracking] ⚡ gtag already initialized, skipping setup");
10436
- resolve();
10437
- return;
10438
- }
10439
- console.log("[Google Ads Tracking] 📦 gtag not found, creating new script element...");
10440
- try {
10441
- // Create the gtag script
10442
- const script = document.createElement("script");
10443
- script.async = true;
10444
- script.src = `https://www.googletagmanager.com/gtag/js?id=${tagId}`;
10445
- console.log("[Google Ads Tracking] 🌐 Script src set to:", script.src);
10446
- script.onload = () => {
10447
- console.log("[Google Ads Tracking] 📥 Script loaded successfully, initializing gtag...");
10448
- // Initialize gtag
10449
- window.dataLayer = window.dataLayer || [];
10450
- console.log("[Google Ads Tracking] 📊 dataLayer initialized");
10451
- window.gtag = (...args) => {
10452
- window.dataLayer.push(args);
10453
- };
10454
- console.log("[Google Ads Tracking] 🔧 gtag function created");
10455
- // Configure gtag
10456
- console.log("[Google Ads Tracking] ⚙️ Configuring gtag with privacy settings...");
10457
- window.gtag("js", new Date());
10458
- window.gtag("config", tagId, {
10459
- // Respect consent settings
10460
- anonymize_ip: true,
10461
- allow_google_signals: false,
10462
- allow_ad_personalization_signals: false,
10463
- });
10464
- console.log("[Google Ads Tracking] ✅ gtag initialized successfully with tagId:", tagId);
10465
- resolve();
10466
- };
10467
- script.onerror = (error) => {
10468
- console.error("[Google Ads Tracking] ❌ Failed to load Google Tag script:", error);
10469
- reject(new Error("Failed to load Google Tag script"));
10470
- };
10471
- console.log("[Google Ads Tracking] 📑 Adding script to document head...");
10472
- // Add script to head
10473
- document.head.appendChild(script);
10474
- console.log("[Google Ads Tracking] ✅ Script element appended to head");
10475
- }
10476
- catch (error) {
10477
- console.error("[Google Ads Tracking] ❌ Error during gtag initialization:", error);
10478
- reject(error);
10479
- }
10334
+ // Initialize dataLayer and gtag function
10335
+ window.dataLayer = window.dataLayer || [];
10336
+ window.gtag = (...args) => {
10337
+ window.dataLayer.push(args);
10338
+ };
10339
+ // Set current timestamp
10340
+ window.gtag("js", new Date());
10341
+ // Load gtag script
10342
+ const script = document.createElement("script");
10343
+ script.async = true;
10344
+ script.src = `https://www.googletagmanager.com/gtag/js?id=${tagId}`;
10345
+ document.head.appendChild(script);
10346
+ // Configure the tag
10347
+ window.gtag("config", tagId, {
10348
+ anonymize_ip: true,
10349
+ allow_google_signals: false,
10350
+ allow_ad_personalization_signals: false,
10480
10351
  });
10481
10352
  }
10482
10353
  /**
10483
- * Track a Google Ads conversion
10354
+ * Send conversion event using available gtag
10484
10355
  */
10485
- function trackConversion(config) {
10486
- console.log("[Google Ads Tracking] 🎯 Starting conversion tracking with config:", config);
10356
+ function sendConversion(config) {
10487
10357
  if (typeof window === "undefined") {
10488
- console.warn("[Google Ads Tracking] ❌ Window object not available");
10489
10358
  return;
10490
10359
  }
10491
- console.log("[Google Ads Tracking] ✅ Window object available");
10492
- if (!config.tagId || !config.conversionId) {
10493
- console.warn("[Google Ads Tracking] Missing tagId or conversionId", {
10494
- tagId: config.tagId,
10495
- conversionId: config.conversionId,
10496
- });
10497
- return;
10360
+ let gtag = window.gtag;
10361
+ // Try parent window gtag if current window doesn't have it
10362
+ if (typeof gtag !== "function" && window !== window.parent) {
10363
+ try {
10364
+ gtag = window.parent?.gtag;
10365
+ }
10366
+ catch {
10367
+ // Cannot access parent window (cross-origin)
10368
+ }
10498
10369
  }
10499
- console.log("[Google Ads Tracking] ✅ Required config fields present:", {
10500
- tagId: config.tagId,
10501
- conversionId: config.conversionId,
10502
- });
10503
- if (typeof window.gtag !== "function") {
10504
- console.warn("[Google Ads Tracking] ❌ gtag function not available");
10370
+ if (typeof gtag !== "function") {
10505
10371
  return;
10506
10372
  }
10507
- console.log("[Google Ads Tracking] ✅ gtag function is available");
10508
- try {
10509
- console.log("[Google Ads Tracking] 🔧 Building conversion data...");
10510
- const conversionData = {
10511
- send_to: `${config.tagId}/${config.conversionId}`,
10512
- };
10513
- console.log("[Google Ads Tracking] 📋 Base conversion data:", conversionData);
10514
- // Add optional parameters
10515
- if (config.conversionValue !== undefined) {
10516
- conversionData.value = config.conversionValue;
10517
- console.log("[Google Ads Tracking] 💰 Added conversion value:", config.conversionValue);
10518
- }
10519
- if (config.conversionCurrency) {
10520
- conversionData.currency = config.conversionCurrency;
10521
- console.log("[Google Ads Tracking] 💱 Added currency:", config.conversionCurrency);
10522
- }
10523
- if (config.transactionId) {
10524
- conversionData.transaction_id = config.transactionId;
10525
- console.log("[Google Ads Tracking] 🔖 Added transaction ID:", config.transactionId);
10526
- }
10527
- console.log("[Google Ads Tracking] 📦 Final conversion data:", conversionData);
10528
- // Track the conversion
10529
- console.log("[Google Ads Tracking] 🚀 Sending conversion event to gtag...");
10530
- window.gtag("event", "conversion", conversionData);
10531
- console.log("[Google Ads Tracking] ✅ Conversion tracked successfully:", conversionData);
10373
+ // Build conversion data
10374
+ const conversionData = {
10375
+ send_to: `${config.tagId}/${config.conversionId}`,
10376
+ };
10377
+ // Add optional parameters
10378
+ if (config.conversionValue !== undefined) {
10379
+ conversionData.value = config.conversionValue;
10532
10380
  }
10533
- catch (error) {
10534
- console.error("[Google Ads Tracking] ❌ Error tracking conversion:", error);
10381
+ if (config.conversionCurrency) {
10382
+ conversionData.currency = config.conversionCurrency;
10535
10383
  }
10384
+ if (config.transactionId) {
10385
+ conversionData.transaction_id = config.transactionId;
10386
+ }
10387
+ // Send conversion event
10388
+ gtag("event", "conversion", conversionData);
10536
10389
  }
10537
10390
  /**
10538
10391
  * Main function to handle Google Ads conversion tracking
10539
- * This function checks consent, initializes gtag if needed, and tracks the conversion
10392
+ * Waits 1500ms, checks/initializes gtag, then sends conversion
10540
10393
  */
10541
- async function handleGoogleAdsConversion(config) {
10542
- console.log("[Google Ads Tracking] 🎬 Starting handleGoogleAdsConversion with config:", config);
10543
- // Validate config
10394
+ function handleGoogleAdsConversion(config) {
10395
+ // Validate required config
10544
10396
  if (!config.tagId || !config.conversionId) {
10545
- console.log("[Google Ads Tracking] ❌ No tagId or conversionId provided, skipping conversion tracking", { tagId: config.tagId, conversionId: config.conversionId });
10546
- return;
10547
- }
10548
- console.log("[Google Ads Tracking] ✅ Config validation passed");
10549
- // Check consent first
10550
- console.log("[Google Ads Tracking] 🔐 Checking consent...");
10551
- if (!checkGoogleConsent()) {
10552
- console.log("[Google Ads Tracking] 🚫 Google consent not granted, skipping conversion tracking");
10553
10397
  return;
10554
10398
  }
10555
- console.log("[Google Ads Tracking] Consent check passed");
10556
- try {
10557
- // Initialize gtag if not already present
10558
- console.log("[Google Ads Tracking] 🔍 Checking if gtag needs initialization...");
10559
- if (!isGtagInitialized()) {
10560
- console.log("[Google Ads Tracking] 🚀 Initializing gtag...");
10561
- await initializeGtag(config.tagId);
10562
- console.log("[Google Ads Tracking] ✅ gtag initialization completed");
10399
+ // Wait 1500ms before proceeding
10400
+ setTimeout(() => {
10401
+ // Check if gtag is available, initialize if not
10402
+ if (!isGtagAvailable()) {
10403
+ initializeGtag(config.tagId);
10563
10404
  }
10564
- else {
10565
- console.log("[Google Ads Tracking] ⚡ gtag already initialized, proceeding...");
10566
- }
10567
- // Small delay to ensure gtag is ready
10568
- console.log("[Google Ads Tracking] ⏱️ Adding 100ms delay to ensure gtag is ready...");
10569
- setTimeout(() => {
10570
- console.log("[Google Ads Tracking] 🎯 Delay completed, tracking conversion...");
10571
- trackConversion(config);
10572
- }, 100);
10573
- }
10574
- catch (error) {
10575
- console.error("[Google Ads Tracking] ❌ Error handling conversion:", error);
10576
- }
10577
- }
10578
- /**
10579
- * Utility function to get conversion value from booking data
10580
- */
10581
- function getConversionValueFromBooking(bookingData) {
10582
- console.log("[Google Ads Tracking] 💰 Extracting conversion value from booking data:", bookingData);
10583
- // Try to get the total amount from various possible structures
10584
- const possiblePaths = [
10585
- { path: "order.total", value: bookingData?.order?.total },
10586
- { path: "booking.total", value: bookingData?.booking?.total },
10587
- { path: "total", value: bookingData?.total },
10588
- { path: "amount", value: bookingData?.amount },
10589
- { path: "payment.amount", value: bookingData?.payment?.amount },
10590
- { path: "stripePaymentIntent.amount", value: bookingData?.stripePaymentIntent?.amount },
10591
- ];
10592
- console.log("[Google Ads Tracking] 🔍 Checking possible value paths:", possiblePaths);
10593
- for (const { path, value } of possiblePaths) {
10594
- console.log(`[Google Ads Tracking] 📋 Checking path '${path}':`, value);
10595
- if (typeof value === "number" && value > 0) {
10596
- // Convert from cents to euros
10597
- const convertedValue = value / 100;
10598
- console.log(`[Google Ads Tracking] ✅ Found valid value at '${path}': ${value} cents = ${convertedValue} euros`);
10599
- return convertedValue;
10600
- }
10601
- }
10602
- console.log("[Google Ads Tracking] ❌ No valid conversion value found in booking data");
10603
- return undefined;
10405
+ sendConversion(config);
10406
+ }, 1500);
10604
10407
  }
10605
10408
 
10606
10409
  const BookingSuccessModal = ({ isOpen, onClose, config, onError, paymentIntentId, }) => {
@@ -10651,11 +10454,10 @@ const BookingSuccessModal = ({ isOpen, onClose, config, onError, paymentIntentId
10651
10454
  const finalPaymentStatus = data.stripePaymentIntent?.status || data.order.status;
10652
10455
  if (finalPaymentStatus === "succeeded" &&
10653
10456
  config.googleAds?.tagId &&
10654
- config.googleAds?.conversionId) {
10457
+ config.googleAds?.conversionId &&
10458
+ config.googleAds?.consent !== false) {
10655
10459
  // Prepare conversion tracking data
10656
- const conversionValue = config.googleAds.includeValue !== false
10657
- ? getConversionValueFromBooking(data)
10658
- : undefined;
10460
+ const conversionValue = data.order.total;
10659
10461
  const transactionId = data.order.id;
10660
10462
  // Track the conversion
10661
10463
  handleGoogleAdsConversion({
@@ -10664,8 +10466,6 @@ const BookingSuccessModal = ({ isOpen, onClose, config, onError, paymentIntentId
10664
10466
  conversionValue,
10665
10467
  conversionCurrency: config.googleAds.conversionCurrency || "EUR",
10666
10468
  transactionId,
10667
- }).catch((error) => {
10668
- console.warn("[BookingSuccessModal] Google Ads conversion tracking failed:", error);
10669
10469
  });
10670
10470
  }
10671
10471
  }
@@ -10747,7 +10547,7 @@ const BookingSuccessModal = ({ isOpen, onClose, config, onError, paymentIntentId
10747
10547
  fontWeight: "600",
10748
10548
  color: "var(--bw-highlight-color)",
10749
10549
  margin: "0px 10px",
10750
- }, children: "Buchung erfolgreich erstellt!" })] }), jsxRuntime.jsx("button", { onClick: handlePrint, style: {
10550
+ }, children: "Reservierung erfolgreich!" })] }), jsxRuntime.jsx("button", { onClick: handlePrint, style: {
10751
10551
  backgroundColor: "transparent",
10752
10552
  border: `1px solid var(--bw-border-color)`,
10753
10553
  color: "var(--bw-text-color)",