@bigz-app/booking-widget 1.3.1 → 1.3.3
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.
- package/dist/booking-widget.js +230 -83
- package/dist/booking-widget.js.map +1 -1
- package/dist/components/UniversalBookingWidget.d.ts +0 -7
- package/dist/components/UniversalBookingWidget.d.ts.map +1 -1
- package/dist/components/booking/BookingSuccessModal.d.ts +3 -1
- package/dist/components/booking/BookingSuccessModal.d.ts.map +1 -1
- package/dist/index.cjs +230 -83
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +230 -83
- package/dist/index.esm.js.map +1 -1
- package/dist/utils/analytics.d.ts +17 -0
- package/dist/utils/analytics.d.ts.map +1 -0
- package/dist/utils/google-ads-tracking.d.ts +9 -19
- package/dist/utils/google-ads-tracking.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Widget analytics — server-side PostHog tracking via batched sendBeacon.
|
|
3
|
+
*
|
|
4
|
+
* Events are buffered locally and flushed every few seconds (or on page
|
|
5
|
+
* unload) as a single POST to `/api/booking/track`. This avoids extra
|
|
6
|
+
* network requests on every click while still capturing a complete funnel.
|
|
7
|
+
*/
|
|
8
|
+
export type WidgetEvent = "widget_loaded" | "event_types_loaded" | "event_type_selected" | "event_instance_selected" | "booking_form_opened" | "booking_completed" | "voucher_card_clicked" | "voucher_purchased" | "upsell_step_viewed" | "promo_dialog_shown" | "promo_cta_clicked";
|
|
9
|
+
/**
|
|
10
|
+
* Initialise the analytics module. Must be called once before `trackEvent`.
|
|
11
|
+
*/
|
|
12
|
+
export declare function initAnalytics(apiBaseUrl: string, organizationId: string): void;
|
|
13
|
+
/**
|
|
14
|
+
* Queue a widget event. Non-blocking, fire-and-forget.
|
|
15
|
+
*/
|
|
16
|
+
export declare function trackEvent(event: WidgetEvent, properties?: Record<string, unknown>): void;
|
|
17
|
+
//# sourceMappingURL=analytics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../src/utils/analytics.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,MAAM,MAAM,WAAW,GACpB,eAAe,GACf,oBAAoB,GACpB,qBAAqB,GACrB,yBAAyB,GACzB,qBAAqB,GACrB,mBAAmB,GACnB,sBAAsB,GACtB,mBAAmB,GACnB,oBAAoB,GACpB,oBAAoB,GACpB,mBAAmB,CAAC;AA0DvB;;GAEG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,QAUvE;AAED;;GAEG;AACH,wBAAgB,UAAU,CACzB,KAAK,EAAE,WAAW,EAClB,UAAU,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,QAexC"}
|
|
@@ -1,33 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Google Ads
|
|
2
|
+
* Google Ads Tracking Utility
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Handles pageview tracking (widget load) and conversion tracking (successful booking).
|
|
5
|
+
* Supports both direct gtag.js and GTM dataLayer setups.
|
|
5
6
|
*/
|
|
6
7
|
export interface GoogleAdsConfig {
|
|
7
|
-
/**
|
|
8
|
-
* Google Ads Tag ID (e.g., 'AW-XXXXXXX')
|
|
9
|
-
*/
|
|
10
8
|
tagId: string;
|
|
11
|
-
/**
|
|
12
|
-
* Google Ads Conversion ID/Label (e.g., 'booking_conversion')
|
|
13
|
-
*/
|
|
14
9
|
conversionId: string;
|
|
15
|
-
/**
|
|
16
|
-
* Optional conversion value for the booking
|
|
17
|
-
*/
|
|
18
10
|
conversionValue?: number;
|
|
19
|
-
/**
|
|
20
|
-
* Optional conversion currency (defaults to 'EUR')
|
|
21
|
-
*/
|
|
22
11
|
conversionCurrency?: string;
|
|
23
|
-
/**
|
|
24
|
-
* Optional transaction ID for deduplication
|
|
25
|
-
*/
|
|
26
12
|
transactionId?: string;
|
|
27
13
|
}
|
|
28
14
|
/**
|
|
29
|
-
*
|
|
30
|
-
|
|
15
|
+
* Track widget pageview (fired once on widget mount).
|
|
16
|
+
*/
|
|
17
|
+
export declare function handleGoogleAdsPageview(tagId: string, consent: boolean): void;
|
|
18
|
+
/**
|
|
19
|
+
* Handle Google Ads conversion tracking.
|
|
20
|
+
* Waits 1500ms for the success page to settle, then fires.
|
|
31
21
|
*/
|
|
32
22
|
export declare function handleGoogleAdsConversion(config: GoogleAdsConfig): void;
|
|
33
23
|
//# 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
|
|
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,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;CACvB;AAqGD;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAyB7E;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CAsBvE"}
|