From c646815a3a1c8134a4aeb6fe262cd886a45ecbab Mon Sep 17 00:00:00 2001 From: Marc Mintel Date: Fri, 20 Feb 2026 15:29:50 +0100 Subject: [PATCH] chore(analytics): completely scrub NEXT_PUBLIC prefix from umami website id across codebase and docs --- components/analytics/EXAMPLES.md | 115 +++++++----------- components/analytics/QUICK_REFERENCE.md | 41 ++++--- components/analytics/README.md | 54 ++++---- components/analytics/SUMMARY.md | 34 ++++-- docs/SERVER_SETUP.md | 2 +- lib/config.ts | 2 +- lib/env.ts | 2 +- lib/services/analytics/README.md | 50 +++++--- .../analytics/noop-analytics-service.ts | 2 +- lib/services/create-services.ts | 2 +- 10 files changed, 147 insertions(+), 157 deletions(-) diff --git a/components/analytics/EXAMPLES.md b/components/analytics/EXAMPLES.md index 921c43cf..85b4d6f9 100644 --- a/components/analytics/EXAMPLES.md +++ b/components/analytics/EXAMPLES.md @@ -136,18 +136,14 @@ function AddToCartButton({ product, quantity = 1 }) { product_category: product.category, price: product.price, quantity: quantity, - cart_total: 150.00, // Current cart total + cart_total: 150.0, // Current cart total }); // Actual add to cart logic // addToCart(product, quantity); }; - return ( - - ); + return ; } ``` @@ -171,7 +167,7 @@ function CheckoutComplete({ order }) { transaction_tax: order.tax, transaction_shipping: order.shipping, product_count: order.items.length, - products: order.items.map(item => ({ + products: order.items.map((item) => ({ product_id: item.product.id, product_name: item.product.name, quantity: item.quantity, @@ -198,27 +194,21 @@ function WishlistButton({ product }) { const toggleWishlist = () => { const newState = !isInWishlist; - + trackEvent( - newState - ? AnalyticsEvents.PRODUCT_WISHLIST_ADD - : AnalyticsEvents.PRODUCT_WISHLIST_REMOVE, + newState ? AnalyticsEvents.PRODUCT_WISHLIST_ADD : AnalyticsEvents.PRODUCT_WISHLIST_REMOVE, { product_id: product.id, product_name: product.name, product_category: product.category, - } + }, ); setIsInWishlist(newState); // Update wishlist in backend }; - return ( - - ); + return ; } ``` @@ -268,7 +258,7 @@ function ContactForm() { }; const handleChange = (e: React.ChangeEvent) => { - setFormData(prev => ({ + setFormData((prev) => ({ ...prev, [e.target.name]: e.target.value, })); @@ -310,9 +300,7 @@ function NewsletterSignup() { return (
- +
); } @@ -396,10 +384,12 @@ function LoginForm() { }; return ( -
{ - e.preventDefault(); - handleLogin('user@example.com', 'password'); - }}> + { + e.preventDefault(); + handleLogin('user@example.com', 'password'); + }} + > {/* Form fields */}
@@ -418,11 +408,7 @@ import { AnalyticsEvents } from '@/components/analytics/analytics-events'; function SignupForm() { const { trackEvent } = useAnalytics(); - const handleSignup = (userData: { - email: string; - name: string; - company?: string; - }) => { + const handleSignup = (userData: { email: string; name: string; company?: string }) => { trackEvent(AnalyticsEvents.USER_SIGNUP, { user_email: userData.email, user_name: userData.name, @@ -436,14 +422,16 @@ function SignupForm() { }; return ( -
{ - e.preventDefault(); - handleSignup({ - email: 'user@example.com', - name: 'John Doe', - company: 'ACME Corp', - }); - }}> + { + e.preventDefault(); + handleSignup({ + email: 'user@example.com', + name: 'John Doe', + company: 'ACME Corp', + }); + }} + > {/* Form fields */}
@@ -483,7 +471,7 @@ function SearchBar() { return (
- setQuery(e.target.value)} placeholder="Search products..." @@ -549,7 +537,7 @@ function ProductFilters() { - +
); @@ -631,11 +619,7 @@ function VideoPlayer({ videoId, videoTitle }) { }; return ( -