# gumroad-ecommerce-integration > Handles Gumroad store integration, purchase buttons, product synchronization, and checkout flows for SketchUp extensions. Use when implementing purchase functionality or managing Gumroad products. - Author: mlamey - Repository: mostafalamey/ML-Extensions-website - Version: 20260207231332 - Stars: 0 - Forks: 0 - Last Updated: 2026-02-07 - Source: https://github.com/mostafalamey/ML-Extensions-website - Web: https://mule.run/skillshub/@@mostafalamey/ML-Extensions-website~gumroad-ecommerce-integration:20260207231332 --- --- name: gumroad-ecommerce-integration description: Handles Gumroad store integration, purchase buttons, product synchronization, and checkout flows for SketchUp extensions. Use when implementing purchase functionality or managing Gumroad products. --- # Gumroad E-commerce Integration Integrate Gumroad seamlessly into the ML Extensions website for smooth purchasing experience. ## Gumroad Embed Methods ### 1. Direct Purchase Links ```jsx const GumroadButton = ({ productId, price, productName }) => { const gumroadUrl = `https://gum.co/${productId}?wanted=true`; return ( Buy {productName} - ${price} ); }; ``` ### 2. Embedded Checkout Overlay ```jsx import { useEffect } from 'react'; const GumroadOverlay = ({ productId, isOpen, onClose }) => { useEffect(() => { if (isOpen && window.GumroadOverlay) { window.GumroadOverlay.open({ url: `https://gum.co/${productId}`, title: 'Purchase Extension' }); } }, [isOpen, productId]); // Load Gumroad overlay script useEffect(() => { const script = document.createElement('script'); script.src = 'https://gumroad.com/js/gumroad-overlay.js'; script.async = true; document.body.appendChild(script); return () => { document.body.removeChild(script); }; }, []); return null; }; ``` ### 3. Product Information Integration ```jsx const GumroadProduct = ({ productId }) => { const [product, setProduct] = useState(null); const [loading, setLoading] = useState(true); useEffect(() => { // Fetch product info from Gumroad API fetch(`https://api.gumroad.com/v2/products/${productId}`) .then(res => res.json()) .then(data => { setProduct(data.product); setLoading(false); }) .catch(err => { console.error('Failed to load product:', err); setLoading(false); }); }, [productId]); if (loading) return
Loading...
; if (!product) return
Product not found
; return (

{product.name}

{product.description}

${(product.price / 100).toFixed(2)}
); }; ``` ## Enhanced Purchase Buttons ### Primary CTA Button ```jsx const PrimaryPurchaseButton = ({ extension }) => (
🚀 Get {extension.name} Now - ${extension.price}
✅ Instant Download ✅ 30-Day Guarantee ✅ Email Support
); ``` ### Secondary CTA Buttons ```jsx const SecondaryCTA = ({ extension }) => (
Buy Now - ${extension.price}
); ``` ## Discount Code Integration ```jsx const DiscountBanner = ({ discountCode, discountPercent, expiryDate }) => { const isExpired = new Date() > new Date(expiryDate); if (isExpired) return null; return (
🔥 Limited Time: {discountPercent}% OFF with code "{discountCode}"
Expires {new Date(expiryDate).toLocaleDateString()}
); }; ``` ## Purchase Analytics Tracking ```jsx const trackPurchaseClick = (extensionName, price, source) => { // Google Analytics 4 if (typeof gtag !== 'undefined') { gtag('event', 'begin_checkout', { currency: 'USD', value: parseFloat(price), items: [{ item_id: extensionName.toLowerCase().replace(/\s+/g, '-'), item_name: extensionName, category: 'SketchUp Extension', price: parseFloat(price), quantity: 1 }] }); } // Facebook Pixel if (typeof fbq !== 'undefined') { fbq('track', 'InitiateCheckout', { content_name: extensionName, content_type: 'product', value: parseFloat(price), currency: 'USD' }); } }; ``` ## Affiliate Link Support ```jsx const generateAffiliateLink = (productId, affiliateCode) => { const baseUrl = `https://gum.co/${productId}`; const params = new URLSearchParams({ wanted: 'true', ...(affiliateCode && { affiliate: affiliateCode }) }); return `${baseUrl}?${params.toString()}`; }; ``` ## Customer Success Flow ```jsx const PurchaseSuccessModal = ({ isOpen, onClose, extension }) => { if (!isOpen) return null; return (
🎉

Thank You!

Your purchase of {extension.name} is complete. Check your email for download instructions.

Need help? Contact Support
); }; ``` ## Security & Error Handling - Always use HTTPS for purchase links - Validate product IDs before generating links - Handle network errors gracefully - Implement retry logic for failed API calls - Log purchase events for analytics - Provide clear error messages to users ## Testing Checklist - [ ] Purchase button functionality - [ ] Discount code application - [ ] Mobile responsiveness - [ ] Analytics tracking - [ ] Error handling - [ ] Loading states - [ ] Accessibility compliance