A comprehensive e-commerce demo application for demonstrating Snowplow Signals integration during workshops. This app showcases how real-time user behavior can trigger personalized interventions based on calculated attributes.
@snowplow-incubator/com-snowplowanalytics-engineering-digital_analytics
- 🛍️ Product catalog with modal view fetched from dummyjson.com API
- 📊 Snowplow JavaScript tracker with ecommerce plugin integration
- 🎨 Intervention banners using Snowplow Signals (discount, free shipping, cart abandonment, recommendations)
- 📈 Event tracking for product views, cart actions, and interventions
Attributes are real-time user features calculated from Snowplow events, representing user behavior patterns:
count_product_views: Number of product view events (ecommerce actions)count_add_to_cart: Number of add-to-cart eventstotal_cart_value: Sum of prices from add-to-cart events
Interventions are real-time personalization triggers that fire when user attributes meet specific criteria:
cart_abandonment: Triggers whencount_add_to_cart > 0discount: Triggers whencount_product_views > 3free_shipping: Triggers whentotal_cart_value > 100
- Events → User actions (product views, cart additions) are tracked
- Attributes → Real-time calculations based on event patterns
- Interventions → Rules that trigger when attribute thresholds are met
- Personalization → Banners, offers, or content shown to users
- Frontend: React TypeScript application with Snowplow tracking
- Signals Processing: Real-time attribute calculation and intervention triggering
- API: RESTful endpoints + Server-Sent Events for live interventions
- Python 3.7+
- Node.js 14+
- npm or yarn
- Install Node dependencies:
cd frontend
npm install- Start the React development server:
npm startThe frontend will run on http://localhost:3000
- Open
http://localhost:3000in your browser - Browse products (each view is tracked)
- Click "Add to Cart" buttons (tracked as cart events)
- Watch for intervention banners that appear automatically
- Interventions are simulated and sent via Server-Sent Events every 10-30 seconds
- Collector Endpoint:
https://collector-sales-aws.snowplow.io - App ID:
ai_demo - Platform:
web - Plugins: Browser tracker + Ecommerce plugin
- Page views (automatic)
- Product views (when clicking on products) - Uses ecommerce plugin
- Add to cart actions - Uses ecommerce plugin
The demo implements three real interventions based on the Signals configuration:
- Trigger: User has added items to cart (
count_add_to_cart > 0) - Message: "Don't forget your items in cart!"
- Purpose: Re-engage users who have items in their cart
- Trigger: User has viewed many products (
count_product_views > 3) - Message: "10% off your next purchase!"
- Code:
SAVE10 - Purpose: Convert high-intent browsers
- Trigger: User has high cart value (
total_cart_value > 100) - Message: "Free shipping on orders over $100!"
- Code:
FREE - Purpose: Encourage larger purchases
See the notebook in signals/attributes_and_interventions.ipynb for details on attribute and intervention definition.