@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,18 +1,17 @@
1
1
  /**
2
2
  * Google Ads Conversion Tracking Utility
3
3
  *
4
- * This utility handles Google Ads conversion tracking for the booking widget.
5
- * It includes consent checking, gtag initialization, and conversion tracking.
4
+ * Simplified utility that waits 1500ms, checks/initializes gtag, and sends conversion.
6
5
  */
7
6
  export interface GoogleAdsConfig {
8
7
  /**
9
8
  * Google Ads Tag ID (e.g., 'AW-XXXXXXX')
10
9
  */
11
- tagId?: string;
10
+ tagId: string;
12
11
  /**
13
12
  * Google Ads Conversion ID/Label (e.g., 'booking_conversion')
14
13
  */
15
- conversionId?: string;
14
+ conversionId: string;
16
15
  /**
17
16
  * Optional conversion value for the booking
18
17
  */
@@ -26,40 +25,9 @@ export interface GoogleAdsConfig {
26
25
  */
27
26
  transactionId?: string;
28
27
  }
29
- /**
30
- * Interface for Google Consent Mode state
31
- */
32
- export interface ConsentData {
33
- ad_storage?: "granted" | "denied";
34
- analytics_storage?: "granted" | "denied";
35
- functionality_storage?: "granted" | "denied";
36
- personalization_storage?: "granted" | "denied";
37
- security_storage?: "granted" | "denied";
38
- }
39
- /**
40
- * Check if Google Consent Mode has granted the necessary permissions for ads tracking
41
- * This checks multiple sources of consent state in order of preference
42
- */
43
- export declare function checkGoogleConsent(): boolean;
44
- /**
45
- * Check if gtag is already initialized on the host page
46
- */
47
- export declare function isGtagInitialized(): boolean;
48
- /**
49
- * Initialize Google Tag (gtag) if not already present
50
- */
51
- export declare function initializeGtag(tagId: string): Promise<void>;
52
- /**
53
- * Track a Google Ads conversion
54
- */
55
- export declare function trackConversion(config: GoogleAdsConfig): void;
56
28
  /**
57
29
  * Main function to handle Google Ads conversion tracking
58
- * This function checks consent, initializes gtag if needed, and tracks the conversion
59
- */
60
- export declare function handleGoogleAdsConversion(config: GoogleAdsConfig): Promise<void>;
61
- /**
62
- * Utility function to get conversion value from booking data
30
+ * Waits 1500ms, checks/initializes gtag, then sends conversion
63
31
  */
64
- export declare function getConversionValueFromBooking(bookingData: any): number | undefined;
32
+ export declare function handleGoogleAdsConversion(config: GoogleAdsConfig): void;
65
33
  //# sourceMappingURL=google-ads-tracking.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"google-ads-tracking.d.ts","sourceRoot":"","sources":["../../src/utils/google-ads-tracking.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,eAAe;IAC/B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC3B,UAAU,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAClC,iBAAiB,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IACzC,qBAAqB,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC7C,uBAAuB,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC/C,gBAAgB,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;CACxC;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAoH5C;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CA0B3C;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAqE3D;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CAiE7D;AAED;;;GAGG;AACH,wBAAsB,yBAAyB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CA6CtF;AAED;;GAEG;AACH,wBAAgB,6BAA6B,CAAC,WAAW,EAAE,GAAG,GAAG,MAAM,GAAG,SAAS,CAiClF"}
1
+ {"version":3,"file":"google-ads-tracking.d.ts","sourceRoot":"","sources":["../../src/utils/google-ads-tracking.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,eAAe;IAC/B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACvB;AA4GD;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CAevE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigz-app/booking-widget",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
4
  "description": "Booking widget for Big Z Booking System @ bigz.app",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",