--- name: fullstory-ecommerce version: v2 description: Industry-specific guide for implementing Fullstory in e-commerce and retail applications. Covers conversion funnel optimization, product interaction tracking, cart abandonment analysis, checkout flow privacy (PCI compliance), and customer journey mapping. Includes detailed examples for product pages, cart, checkout, and post-purchase experiences. related_skills: - fullstory-privacy-controls - fullstory-privacy-strategy - fullstory-analytics-events - fullstory-page-properties - fullstory-element-properties --- # Fullstory for E-Commerce & Retail > ⚠️ **LEGAL DISCLAIMER**: This guidance is for educational purposes only and does not constitute legal, compliance, or regulatory advice. E-commerce regulations (PCI DSS for payments, GDPR, CCPA, consumer protection laws) vary by jurisdiction. Always consult with your legal and compliance teams before implementing any data capture solution. Your organization is responsible for ensuring compliance with all applicable regulations. ## Industry Overview E-commerce has unique opportunities and requirements for session analytics: - **High analytics value**: Product interactions, funnels, conversions directly impact revenue - **Rich behavioral data**: Browse patterns, search, filters, comparisons - **PCI compliance**: Payment flows require careful handling - **Customer journey focus**: Multi-session journeys, cross-device behavior - **A/B testing**: Variant analysis is crucial ### Key Goals for E-Commerce Implementations 1. **Optimize conversion funnels** from browse to purchase 2. **Understand product engagement** (views, interactions, comparisons) 3. **Reduce cart abandonment** by identifying friction 4. **Improve search and discovery** UX 5. **Analyze post-purchase experience** (returns, support) --- ## What Can Be Captured in E-Commerce Unlike banking, e-commerce has more data that can (and should) be captured: | Data Type | Capture? | Privacy Level | Why | | ---------------- | ----------- | ------------- | -------------------------- | | Product names | ✅ Yes | Unmask | Core analytics value | | Product IDs/SKUs | ✅ Yes | Unmask | Segmentation | | Prices | ✅ Yes | Unmask | Conversion analysis | | Categories | ✅ Yes | Unmask | Journey analysis | | Search queries | ⚠️ Consider | Unmask/Mask | Usually OK, review for PII | | Cart contents | ✅ Yes | Unmask | Abandonment analysis | | Order totals | ✅ Yes | Unmask | Revenue tracking | | Customer name | ⚠️ Mask | Mask | PII but low risk | | Email | ⚠️ Consider | Hash/Mask | For user linking | | Shipping address | ⚠️ Mask | Mask | PII | | Payment card | ❌ Never | Exclude | PCI compliance | | CVV | ❌ Never | Exclude | PCI compliance | --- ## Implementation Architecture ### Privacy Zones for E-Commerce ``` ┌─────────────────────────────────────────────────────────────────┐ │ E-COMMERCE APPLICATION │ ├─────────────────────────────────────────────────────────────────┤ │ FULLY VISIBLE (fs-unmask) │ │ • Product listings and details │ │ • Prices, discounts, promotions │ │ • Category navigation, filters │ │ • Search results │ │ • Cart contents │ │ • Error messages │ │ • UI controls, buttons │ ├─────────────────────────────────────────────────────────────────┤ │ MASKED (fs-mask) │ │ • Customer names │ │ • Email addresses │ │ • Phone numbers │ │ • Shipping/billing addresses │ │ • Order confirmation numbers (optional) │ ├─────────────────────────────────────────────────────────────────┤ │ EXCLUDED (fs-exclude) │ │ • Credit card numbers │ │ • CVV/security codes │ │ • Full card expiry │ │ • PayPal/payment credentials │ │ • Gift card codes (if high value) │ │ • Promo codes (if single-use/valuable) │ └─────────────────────────────────────────────────────────────────┘ ``` ### Marketplace Considerations For multi-vendor marketplaces, additional considerations apply: | Scenario | Privacy Implication | | --------------------------- | -------------------------------------------------------------------- | | **Seller data** | Mask seller personal info (name, location); keep store/business name | | **Buyer-seller messaging** | EXCLUDE all message content | | **Seller performance data** | Exclude revenue, exact sales counts; use bands | | **Cross-seller analytics** | Never capture data that reveals competitive intelligence | | **Seller onboarding** | Exclude bank details, tax IDs; track flow completion only | ```javascript // Marketplace: Track seller interaction without revealing seller economics FS('trackEvent', { name: 'seller_product_viewed', properties: { product_category: 'electronics', seller_rating_band: '4.5-5.0', // Band, not exact rating seller_review_volume: 'high', // "high", "medium", "low" marketplace_verified: true, // NEVER: seller revenue, exact sales, or seller contact info }, }) ``` ### User Identification Pattern ```javascript // E-Commerce: Multiple identification stages // 1. Anonymous visitor (before account creation) // Fullstory auto-assigns anonymous ID // 2. Email captured (newsletter, cart) function onEmailCapture(email) { // Option A: Use hashed email (for cross-device matching) FS('setIdentity', { uid: sha256(email.toLowerCase().trim()), }) // Option B: Wait for account creation, use customer ID // (Preferred if you have account system) } // 3. Account created or logged in function onLogin(customer) { FS('setIdentity', { uid: customer.id, // e.g., "cust_12345" displayName: customer.firstName, // Just first name }) FS('setProperties', { type: 'user', properties: { // Customer value metrics customer_type: customer.isGuest ? 'guest' : 'registered', account_age_days: daysSince(customer.createdAt), lifetime_order_count: customer.orderCount, lifetime_value_band: getValueBand(customer.ltv), // "$0-100", "$100-500", etc. // Engagement signals has_wishlist: customer.wishlistCount > 0, has_saved_payment: customer.hasSavedPayment, email_subscribed: customer.emailOptIn, loyalty_tier: customer.loyaltyTier, // "bronze", "silver", "gold" // Preferences preferred_category: customer.topCategory, preferred_brand: customer.topBrand, // Technical app_installed: customer.hasApp, push_enabled: customer.pushOptIn, }, }) } ``` --- ## Page-by-Page Implementation ### Homepage ```html

Holiday Sale - Up to 50% Off

Shop Now

Recommended for You

``` ```javascript // Homepage tracking FS('setProperties', { type: 'page', properties: { page_type: 'homepage', has_active_promotion: true, promotion_name: 'holiday_sale_2024', featured_product_count: 8, recommendation_engine: 'collaborative_filtering', }, }) ``` ### Product Listing Page (PLP) ```html

Showing 48 results

Sony WH-1000XM5

Sony WH-1000XM5

★★★★★ (2,345 reviews)

$349.99

Best Seller

``` ```javascript // PLP page properties FS('setProperties', { type: 'page', properties: { page_type: 'product_listing', category: 'Electronics > Headphones', category_depth: 2, result_count: 48, has_active_filters: true, active_filters: ['brand:Sony,Bose', 'price:100-200'], sort_order: 'relevance', page_number: 1, }, }) // Filter tracking function onFilterChange(filters) { FS('trackEvent', { name: 'filter_applied', properties: { category: currentCategory, filter_type: filters.changed, // "brand", "price", "rating" filter_value: filters.value, result_count_after: filters.resultCount, }, }) } // Sort tracking function onSortChange(sortOrder) { FS('trackEvent', { name: 'sort_changed', properties: { category: currentCategory, sort_order: sortOrder, result_count: resultCount, }, }) } // Product impression tracking function trackProductImpressions(products) { products.forEach((product, index) => { FS('trackEvent', { name: 'product_impression', properties: { product_id: product.id, product_name: product.name, price: product.price, list_position: index + 1, list_type: 'category_listing', }, }) }) } ``` ### Product Detail Page (PDP) ```html
Sony WH-1000XM5

Sony WH-1000XM5 Wireless Headphones

by Sony

★★★★★ 4.8 (2,345 reviews)
$349.99 $399.99 Save 12%

✓ In Stock - Ships within 24 hours

Industry-leading noise cancellation...

Customer Reviews

John D. ★★★★★ Nov 15, 2024

Amazing noise cancellation...

``` ```javascript // PDP page properties FS('setProperties', { type: 'page', properties: { page_type: 'product_detail', product_id: 'SKU-12345', product_name: 'Sony WH-1000XM5 Wireless Headphones', brand: 'Sony', category: 'Electronics > Headphones > Wireless', price: 349.99, original_price: 399.99, discount_percent: 12, is_on_sale: true, in_stock: true, review_count: 2345, average_rating: 4.8, variant_selected: 'Black', }, }) // Product view event FS('trackEvent', { name: 'product_viewed', properties: { product_id: 'SKU-12345', product_name: 'Sony WH-1000XM5 Wireless Headphones', brand: 'Sony', category: 'Electronics > Headphones', price: 349.99, referrer_type: getReferrerType(), // "search", "category", "recommendation" time_on_page_seconds: 0, // Will be updated on exit }, }) // Variant selection function onVariantSelect(variant) { FS('trackEvent', { name: 'variant_selected', properties: { product_id: product.id, variant_type: variant.type, // "color", "size" variant_value: variant.value, // "Black", "Large" price_change: variant.priceDiff, }, }) } // Image interaction function onImageInteraction(action) { FS('trackEvent', { name: 'image_interaction', properties: { product_id: product.id, action: action, // "zoom", "gallery_view", "thumbnail_click" image_index: currentImageIndex, }, }) } // Tab view function onTabClick(tabName) { FS('trackEvent', { name: 'product_tab_viewed', properties: { product_id: product.id, tab_name: tabName, // "description", "specifications", "reviews" }, }) } ``` ### Shopping Cart ```html

Your Cart (3 items)

Sony WH-1000XM5

Sony WH-1000XM5

Color: Black

$349.99

$349.99
Subtotal $549.97
Shipping FREE
Estimated Tax $44.00
Total $593.97
Continue Shopping
``` ```javascript // Cart page properties FS('setProperties', { type: 'page', properties: { page_type: 'cart', cart_item_count: 3, cart_unique_products: 2, cart_subtotal: 549.97, cart_total: 593.97, has_promo_applied: false, shipping_type: 'free', }, }) // Cart view event FS('trackEvent', { name: 'cart_viewed', properties: { cart_id: cart.id, item_count: cart.items.length, cart_value: cart.total, products: cart.items.map((item) => ({ product_id: item.productId, product_name: item.name, quantity: item.quantity, price: item.price, })), }, }) // Quantity change function onQuantityChange(item, newQty, oldQty) { FS('trackEvent', { name: 'cart_quantity_changed', properties: { product_id: item.productId, product_name: item.name, old_quantity: oldQty, new_quantity: newQty, quantity_change: newQty - oldQty, }, }) } // Item removed function onRemoveItem(item) { FS('trackEvent', { name: 'product_removed_from_cart', properties: { product_id: item.productId, product_name: item.name, price: item.price, quantity: item.quantity, removal_method: 'remove_button', // or "quantity_zero" }, }) } // Promo code function onPromoApply(code, success, discount) { FS('trackEvent', { name: 'promo_code_applied', properties: { success: success, discount_amount: success ? discount : 0, discount_type: success ? 'percentage' : null, // or "fixed" // Don't send the actual code (could be valuable) }, }) } ``` ### Checkout Flow ```html

Checkout

1. Shipping 2. Payment 3. Review

Shipping Address

Shipping Method

Payment Method

``` ```javascript // Checkout step tracking function trackCheckoutStep(step, data) { FS('trackEvent', { name: 'checkout_step_completed', properties: { step_number: step, step_name: data.stepName, // "shipping", "payment", "review" cart_value: cart.total, item_count: cart.items.length, }, }) } // Shipping method selection function onShippingMethodSelect(method) { FS('trackEvent', { name: 'shipping_method_selected', properties: { method: method.name, // "standard", "express", "overnight" cost: method.cost, delivery_days: method.deliveryDays, }, }) } // Payment method selection function onPaymentMethodSelect(method) { FS('trackEvent', { name: 'payment_method_selected', properties: { method: method, // "card", "paypal", "applepay", "klarna" }, }) } // Checkout errors (sanitized) function onCheckoutError(error) { FS('trackEvent', { name: 'checkout_error', properties: { step: currentStep, error_type: categorizeCheckoutError(error), // "validation", "payment_declined", "inventory" // NEVER include: card numbers, specific error messages with PII }, }) } // Order completed function onOrderComplete(order) { FS('trackEvent', { name: 'purchase_completed', properties: { order_id: order.id, order_total: order.total, item_count: order.items.length, payment_method: order.paymentMethod, shipping_method: order.shippingMethod, has_promo: order.promoApplied, is_first_order: customer.orderCount === 1, // Product details products: order.items.map((item) => ({ product_id: item.productId, product_name: item.name, category: item.category, price: item.price, quantity: item.quantity, })), }, }) } ``` ### Search Experience ```javascript // Search tracking function onSearch(query, results) { FS('trackEvent', { name: 'search_performed', properties: { search_query: query, // Usually OK, review for PII patterns result_count: results.length, has_results: results.length > 0, suggestion_used: wasSuggestionClicked, search_type: 'keyword', // or "voice", "visual" }, }) } // Search result click function onSearchResultClick(product, position) { FS('trackEvent', { name: 'search_result_clicked', properties: { search_query: lastQuery, product_id: product.id, product_name: product.name, result_position: position, total_results: lastResultCount, }, }) } // No results function onNoResults(query) { FS('trackEvent', { name: 'search_no_results', properties: { search_query: query, suggestions_shown: suggestionsShown, }, }) } ``` --- ## Cart Abandonment Analysis ### Key Events to Track ```javascript // Add to cart function onAddToCart(product, source) { FS('trackEvent', { name: 'product_added_to_cart', properties: { product_id: product.id, product_name: product.name, price: product.price, quantity: 1, category: product.category, add_source: source, // "pdp", "plp", "quick_add", "recommendation" }, }) } // Cart abandoned (on exit intent or timeout) function onCartAbandoned(cart) { FS('trackEvent', { name: 'cart_abandoned', properties: { cart_id: cart.id, cart_value: cart.total, item_count: cart.items.length, time_since_last_activity_minutes: getInactivityMinutes(), checkout_step_reached: lastCheckoutStep || 'cart', abandonment_trigger: trigger, // "exit_intent", "timeout", "navigation_away" }, }) } // Session end with cart window.addEventListener('beforeunload', () => { if (cart && cart.items.length > 0 && !orderCompleted) { FS('trackEvent', { name: 'session_ended_with_cart', properties: { cart_value: cart.total, item_count: cart.items.length, pages_viewed: pagesViewed, time_on_site_minutes: getSessionDuration(), }, }) } }) ``` --- ## Common E-Commerce Patterns ### Product Interaction Tracking Component ```javascript // React component for product cards with built-in tracking function ProductCard({product, listType, position}) { const handleClick = () => { FS('trackEvent', { name: 'product_clicked', properties: { product_id: product.id, product_name: product.name, price: product.price, list_type: listType, // "search", "category", "recommendation", "cart_upsell" position: position, }, }) } const handleAddToCart = (e) => { e.stopPropagation() FS('trackEvent', { name: 'product_added_to_cart', properties: { product_id: product.id, product_name: product.name, price: product.price, add_source: listType, }, }) // Add to cart logic... } const handleWishlist = (e) => { e.stopPropagation() FS('trackEvent', { name: 'product_added_to_wishlist', properties: { product_id: product.id, product_name: product.name, price: product.price, }, }) // Wishlist logic... } return (
{product.name}

{product.name}

${product.price}

) } ``` ### Customer Lifetime Value Bands ```javascript // Convert LTV to privacy-safe bands function getValueBand(ltv) { if (ltv === 0) return 'new' if (ltv < 100) return '$1-$99' if (ltv < 500) return '$100-$499' if (ltv < 1000) return '$500-$999' if (ltv < 5000) return '$1k-$5k' return '$5k+' } ``` --- ## A/B Testing Integration ```javascript // Track A/B test variant FS('setProperties', { type: 'user', properties: { // Experiment tracking ab_checkout_flow: experimentVariant('checkout_flow'), // "control", "variant_a" ab_product_recommendations: experimentVariant('recommendations'), ab_search_algorithm: experimentVariant('search'), }, }) // Track variant-specific events function trackExperimentExposure(experimentName, variant) { FS('trackEvent', { name: 'experiment_exposure', properties: { experiment_name: experimentName, variant: variant, page: currentPage, }, }) } ``` --- ## KEY TAKEAWAYS FOR AGENT When helping e-commerce clients with Fullstory: 1. **Product data is valuable**: Unlike banking, product names/prices/categories are core analytics - capture them 2. **PCI compliance still applies**: Payment forms must be excluded 3. **Cart abandonment is gold**: Track every step of the funnel 4. **Element properties on product cards**: Enable click analysis 5. **Search queries are usually OK**: But review for PII patterns (searching for people's names, addresses) 6. **Customer PII should be masked**: Names, addresses, emails 7. **Order details are valuable**: Capture order totals, item counts, product details ### Questions to Ask E-Commerce Clients 1. "Are you tracking product impressions as well as clicks?" 2. "How are you handling checkout abandonment?" 3. "Are your product cards using Element Properties?" 4. "What payment methods do you support? (PayPal, Apple Pay, Klarna)" 5. "Do you have A/B tests you want to analyze in Fullstory?" ### Common Mistakes - Over-excluding product information (it's not PII!) - Not tracking the full add-to-cart to purchase funnel - Missing Element Properties on interactive elements - Not tracking search with no results - Excluding the entire checkout instead of just payment fields --- ## REFERENCE LINKS - **Fullstory for E-Commerce**: https://www.fullstory.com/resources/ecommerce - **Element Properties**: ../core/fullstory-element-properties/SKILL.md - **Analytics Events**: ../core/fullstory-analytics-events/SKILL.md - **Privacy Controls**: ../core/fullstory-privacy-controls/SKILL.md --- _This skill document is specific to e-commerce and retail implementations. Adjust privacy controls based on your specific business requirements._