medusa-storefront-analytics 1.3.0 → 1.5.0
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/api/meta-event.d.ts +19 -0
- package/dist/index.d.ts +3 -1
- package/dist/providers/gtm.d.ts +0 -4
- package/dist/ui-library.js +4855 -294
- package/dist/ui-library.umd.cjs +41 -1
- package/package.json +66 -64
- package/src/index.ts +0 -2
- package/src/providers/gtm.ts +0 -19
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { NextRequest, NextResponse } from 'next/server';
|
|
2
|
+
|
|
3
|
+
export type MetaCapiEventBody = {
|
|
4
|
+
event_name?: string;
|
|
5
|
+
event?: string;
|
|
6
|
+
action_source?: string;
|
|
7
|
+
event_source_url?: string;
|
|
8
|
+
event_id?: string;
|
|
9
|
+
custom_data?: Record<string, unknown>;
|
|
10
|
+
user_data?: Record<string, unknown>;
|
|
11
|
+
};
|
|
12
|
+
/** Next.js App Router handler for `POST /api/meta/event` (Meta Conversions API). */
|
|
13
|
+
export declare function POST(req: NextRequest): Promise<NextResponse<{
|
|
14
|
+
success: boolean;
|
|
15
|
+
data: any;
|
|
16
|
+
}> | NextResponse<{
|
|
17
|
+
success: boolean;
|
|
18
|
+
error: any;
|
|
19
|
+
}>>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export type { AnalyticsEventMap, FormSubmittedPayload, ProductRef, ReviewSubmittedPayload, StorefrontAnalyticsAdapter, } from './core/types';
|
|
2
2
|
export { noopAnalyticsAdapter } from './core/noop-adapter';
|
|
3
3
|
export { composeAnalyticsAdapters } from './core/compose';
|
|
4
|
-
export { createGtmAnalyticsAdapter, defaultStorefrontAnalytics, pushToDataLayer, trackGtmEvent,
|
|
4
|
+
export { createGtmAnalyticsAdapter, defaultStorefrontAnalytics, pushToDataLayer, trackGtmEvent, type GtmAnalyticsAdapterOptions, } from './providers/gtm';
|
|
5
5
|
export { emitReviewSubmitted } from './events/reviews';
|
|
6
6
|
export { emitContactFormSubmitted, emitFormSubmitted, emitLeadCaptured, } from './events/forms';
|
|
7
7
|
export { META_STANDARD_EVENTS, type EcommercePayload, type GA4Item, type MetaStandardEventName, } from './events/meta-events';
|
|
8
8
|
export { META_PIXEL_DATALAYER_EVENT, fireMetaPixelEvent, fireMetaEcommerceEvent, fireMetaPurchase, } from './providers/meta-pixel';
|
|
9
9
|
export { META_EXPLICIT_KEY, disableMetaPixelAutoConfig, installMetaPixelGuard, } from './providers/meta-pixel-guard';
|
|
10
|
+
export { POST as metaCapiEventHandler } from './api/meta-event';
|
|
11
|
+
export type { MetaCapiEventBody } from './api/meta-event';
|
|
10
12
|
export { cartToEcommercePayload, markInitiateCheckoutFired, trackAddPaymentInfo, trackAddShippingInfo, trackAddToCart, trackAddToWishlist, trackBeginCheckout, trackCartNavClick, trackCompleteRegistration, trackContact, trackHeroCtaClick, trackInitiateCheckoutFromCart, trackLead, trackMetaStandardEvent, trackPurchase, trackRemoveFromCart, trackSearch, trackViewCart, trackViewItem, trackViewItemList, wasInitiateCheckoutFired, } from './ecommerce/ga4-ecommerce';
|
package/dist/providers/gtm.d.ts
CHANGED
|
@@ -17,7 +17,3 @@ export interface GtmAnalyticsAdapterOptions {
|
|
|
17
17
|
export declare function createGtmAnalyticsAdapter(options?: GtmAnalyticsAdapterOptions): StorefrontAnalyticsAdapter;
|
|
18
18
|
/** Default GTM adapter (legacy form_submit + review events). */
|
|
19
19
|
export declare const defaultStorefrontAnalytics: StorefrontAnalyticsAdapter;
|
|
20
|
-
/** @deprecated Use createGtmAnalyticsAdapter */
|
|
21
|
-
export declare const initGTM: (id: string) => void;
|
|
22
|
-
/** @deprecated Use trackGtmEvent */
|
|
23
|
-
export declare const trackEvent: typeof trackGtmEvent;
|