Shopify Integration Guide
Learn how to integrate Fanfare experiences with your Shopify store, from installation to checkout completion.Overview
Fanfare provides a native Shopify app that integrates virtual queues, draws, and auctions directly with your Shopify storefront. This guide covers both app installation and custom theme integration. What you’ll learn:- Installing and configuring the Fanfare Shopify app
- Embedding experiences in your theme
- Connecting experiences to products
- Handling checkout with Shopify’s native cart
- Processing order webhooks
Prerequisites
- Shopify store (Basic plan or higher)
- Fanfare account with active organization
- Access to Shopify theme editor
Installation Options
Option 1: Fanfare Shopify App (Recommended)
Install the official Fanfare app from the Shopify App Store:- Visit the Fanfare app listing in the Shopify App Store
- Click “Add app” and authorize the permissions
- Connect your Fanfare organization in the app settings
- Configure your first experience
- OAuth authentication with Shopify
- Automatic webhook registration
- Theme app extension for embedding
- Order completion notifications
Option 2: Custom Integration
For stores requiring custom implementations, bundle the current Fanfare SDK into your theme or storefront app and render from the public journey state. Do not rely on the deprecated global CDN snippet.@fanfare-io/fanfare-sdk-core, call sdk.journeys.get(experienceId), render from journey.view$, and hand the admissionGrant to your cart or checkout flow when the sequence reaches admitted. See Custom Platform Integration for the framework-agnostic pattern.
Step 1: Configure Experience in Admin
Create your experience in the Fanfare admin panel:- Navigate to Experiences > Create New
- Select experience type (Queue, Draw, or Auction)
- Configure timing and capacity
- Note the Experience ID for later use
Linking to Shopify Products
Connect experiences to specific products or collections:Step 2: Theme App Extension
The Fanfare Shopify app includes a theme app extension for easy embedding.Adding to Product Pages
- Open Online Store > Themes > Customize
- Navigate to your product template
- Add the Fanfare Experience block
- Configure the block settings:
| Setting | Description |
|---|---|
| Experience Source | Product metafield or manual ID |
| Display Mode | Inline, modal, or full-page |
| Auto-redirect | Redirect to cart on admission |
| Show countdown | Display time remaining |
Block Configuration (Liquid)
Step 3: JavaScript Integration
Initialize the SDK
Buildassets/fanfare-integration.js with the current core SDK package. The script should render from journey.view$ and only offer actions exposed by the current public view.
Include in Theme
Step 4: Cart Line Properties
Store Fanfare data in cart line properties for order processing:Protecting Against Tampering
Validate tokens server-side in your checkout flow:Step 5: Webhook Integration
Configure Webhooks in Shopify App
The Fanfare app automatically registers these webhooks:| Webhook Topic | Purpose |
|---|---|
orders/create | Validate admission and complete |
orders/paid | Confirm successful transaction |
orders/cancelled | Handle cancellations |
refunds/create | Track refund events |
Manual Webhook Setup
If using custom integration, register webhooks via Shopify Admin API:Webhook Handler
Step 6: Product Metafields
Store Fanfare configuration in Shopify metafields:Using Shopify Admin
- Go to Settings > Custom data > Products
- Add metafield definition:
- Namespace:
fanfare - Key:
experience_id - Type: Single line text
- Namespace:
Using Admin API
Step 7: Checkout UI Extension (Shopify Plus)
For Shopify Plus stores, create a checkout UI extension:Styling the Experience
CSS Customization
Best Practices
1. Handle Browser Back Button
2. Mobile Optimization
Troubleshooting
Experience Not Loading
- Check that organization ID metafield is set on shop
- Verify experience ID is correct in product metafield
- Check browser console for SDK errors
- Ensure SDK script is loading (check network tab)
Cart Properties Not Appearing
Shopify may strip properties starting with_ in some contexts:
Webhook Not Firing
- Verify webhook is registered in Shopify admin
- Check webhook delivery logs
- Ensure endpoint URL is publicly accessible
- Verify HMAC signature validation
Token Validation Failing
What’s Next
- WooCommerce Integration - WordPress/WooCommerce setup
- Custom Platform - Build for any platform
- Webhooks Guide - Advanced webhook handling
- Order Completion - Complete order processing