Template
Comment out all analytics (trackers, Shopify scripts, consent banner)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F22Ms5Cxam5UHyxaCrtZzu
This commit is contained in:
co-authored by
Claude Fable 5
parent
1e58ba4ca4
commit
97ee90919f
+14
-10
@@ -1,11 +1,13 @@
|
||||
"use client";
|
||||
|
||||
import type { ConsentConfig, ShopAnalytics } from "@shopify/hydrogen";
|
||||
import { Suspense } from "react";
|
||||
// ANALYTICS DISABLED (temporarily commented out):
|
||||
// import type { ConsentConfig, ShopAnalytics } from "@shopify/hydrogen";
|
||||
// import { Suspense } from "react";
|
||||
import type { ReactNode } from "react";
|
||||
|
||||
import { AnalyticsTracker } from "@/components/AnalyticsTracker";
|
||||
import { CartAnalyticsTracker } from "@/components/CartAnalyticsTracker";
|
||||
// ANALYTICS DISABLED (temporarily commented out):
|
||||
// import { AnalyticsTracker } from "@/components/AnalyticsTracker";
|
||||
// import { CartAnalyticsTracker } from "@/components/CartAnalyticsTracker";
|
||||
import { CartProvider } from "@/lib/cart";
|
||||
import type { cartHandlers } from "@/lib/cart-handlers";
|
||||
|
||||
@@ -30,23 +32,25 @@ export type CartData = Awaited<ReturnType<typeof cartHandlers.get>>["data"];
|
||||
|
||||
export function Providers({
|
||||
cartData,
|
||||
analyticsShop,
|
||||
analyticsConsent,
|
||||
// ANALYTICS DISABLED (temporarily commented out):
|
||||
// analyticsShop,
|
||||
// analyticsConsent,
|
||||
children,
|
||||
}: {
|
||||
cartData?: CartData;
|
||||
analyticsShop: ShopAnalytics;
|
||||
analyticsConsent: ConsentConfig;
|
||||
// ANALYTICS DISABLED (temporarily commented out):
|
||||
// analyticsShop: ShopAnalytics;
|
||||
// analyticsConsent: ConsentConfig;
|
||||
children: ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<CartProvider initialData={cartData}>
|
||||
{/* Suspense scopes the `useSearchParams()` CSR bailout to the tracker,
|
||||
not the whole layout (hydrogen-analytics / references/react.md). */}
|
||||
{/* ANALYTICS DISABLED (temporarily commented out):
|
||||
<Suspense fallback={null}>
|
||||
<AnalyticsTracker shop={analyticsShop} consent={analyticsConsent} />
|
||||
</Suspense>
|
||||
<CartAnalyticsTracker />
|
||||
*/}
|
||||
{children}
|
||||
</CartProvider>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user