mirror of
https://github.com/vercel/commerce.git
synced 2025-05-13 05:07:51 +00:00
14 lines
414 B
TypeScript
14 lines
414 B
TypeScript
'use client';
|
|
|
|
import { useEffect } from 'react';
|
|
import { AnalyticsEventName } from '@shopify/hydrogen-react';
|
|
import { useShopifyAnalytics } from 'lib/shopify/hooks/use-shopify-analytics';
|
|
|
|
export default function ShopifyAnalytics() {
|
|
const { sendPageView, pathname } = useShopifyAnalytics();
|
|
useEffect(() => {
|
|
sendPageView(AnalyticsEventName.PAGE_VIEW);
|
|
}, [pathname, sendPageView]);
|
|
return null;
|
|
}
|