keystone-design-bootstrap 1.0.54 → 1.0.55

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "keystone-design-bootstrap",
3
- "version": "1.0.54",
3
+ "version": "1.0.55",
4
4
  "description": "Keystone Design Bootstrap - Sections, Elements, and Theme System for customer websites",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -79,6 +79,7 @@ export function MetaPixelTracker({ bookingUrl }: Props) {
79
79
  const handleClick = (e: MouseEvent) => {
80
80
  const anchor = (e.target as Element).closest('a');
81
81
  if (anchor?.href?.startsWith(bookingUrl)) {
82
+ console.debug('[MetaPixel] Booking link clicked', { href: anchor.href });
82
83
  trackInitiateCheckout();
83
84
  }
84
85
  };
@@ -7,5 +7,10 @@ type FbqFn = (method: string, eventName: string, params?: object) => void;
7
7
  export function trackInitiateCheckout(): void {
8
8
  if (typeof window === 'undefined') return;
9
9
  const fbq = (window as Window & { fbq?: FbqFn }).fbq;
10
- if (fbq) fbq('track', 'InitiateCheckout');
10
+ if (!fbq) {
11
+ console.debug('[MetaPixel] InitiateCheckout skipped — fbq not loaded');
12
+ return;
13
+ }
14
+ console.debug('[MetaPixel] InitiateCheckout');
15
+ fbq('track', 'InitiateCheckout');
11
16
  }
@@ -5,5 +5,10 @@
5
5
  export function trackMetaLead(eventId: string | undefined): void {
6
6
  if (typeof window === 'undefined' || !eventId) return;
7
7
  const fbq = (window as Window & { fbq?: (method: string, eventName: string, params?: object, options?: { eventID?: string }) => void }).fbq;
8
- if (fbq) fbq('track', 'Lead', {}, { eventID: eventId });
8
+ if (!fbq) {
9
+ console.debug('[MetaPixel] Lead skipped — fbq not loaded', { eventId });
10
+ return;
11
+ }
12
+ console.debug('[MetaPixel] Lead', { eventId });
13
+ fbq('track', 'Lead', {}, { eventID: eventId });
9
14
  }
@@ -7,9 +7,13 @@ type FbqFn = (method: string, eventName: string, params?: object) => void;
7
7
  export function trackViewContent(contentName?: string, contentCategory?: string): void {
8
8
  if (typeof window === 'undefined') return;
9
9
  const fbq = (window as Window & { fbq?: FbqFn }).fbq;
10
- if (!fbq) return;
10
+ if (!fbq) {
11
+ console.debug('[MetaPixel] ViewContent skipped — fbq not loaded', { contentName, contentCategory });
12
+ return;
13
+ }
11
14
  const params: Record<string, string> = {};
12
15
  if (contentName) params.content_name = contentName;
13
16
  if (contentCategory) params.content_category = contentCategory;
17
+ console.debug('[MetaPixel] ViewContent', params);
14
18
  fbq('track', 'ViewContent', params);
15
19
  }