Documentation
Shopify Integration
Connect your Shopify store to LeadMachine for automatic customer and order syncing, AI-powered insights, behavioral segmentation, and a full CRM experience embedded directly inside Shopify admin.
What You Get
- Automatic customer and order syncing with real-time webhooks
- Smart auto-tagging based on purchase behavior and marketing consent
- AI briefings that surface important customer moments
- RFM scoring that segments customers by value and engagement
- Abandoned checkout tracking with automatic follow-up tasks
- Auto-created deals and tasks from order events
- Background enrichment via Hunter.io and Google Places
- Bi-directional marketing consent sync with your email campaigns
- An embedded dashboard inside Shopify admin with inline editing
- A full Shopify welcome page inside LeadMachine with KPIs, segments, and persistent Ledo chat
Setting Up
Prerequisites
- Shopify store owner or staff account with app install permissions
- LeadMachine Admin or SuperAdmin access
Install from Shopify App Store (New Users)
If you're installing LeadMachine from the Shopify App Store for the first time:
- Click Install in the Shopify App Store
- You'll be redirected to the LeadMachine onboarding wizard
- Create your account (Google, Facebook, LinkedIn, or email sign-up)
- Complete your profile and create your company
- Start your free trial (14 days, no credit card required)
- After onboarding, you'll be redirected back to authorize the Shopify connection
- Review permissions and click Install app
If you already have a LeadMachine account, you'll see a "Connect Store to This Account" option instead.
Connect from LeadMachine (Existing Users)
- Go to Company Settings > Integrations
- Click Connect Shopify Store
- Enter your store URL (e.g.
yourstore.myshopify.com) - Click Connect — you'll be redirected to Shopify
- Review the permissions and click Install app
- You'll be redirected back to LeadMachine
Initial Sync
After connecting, click Sync Now to import existing customers and orders. Time depends on data volume:
- Under 100 customers: ~30 seconds
- 100-500: 1-2 minutes
- 500-1,000: 2-5 minutes
- 1,000+: 5-10 minutes
After the first sync, all subsequent syncs are incremental — only pulling customers and orders that changed since the last sync.
What Gets Synced
Customer Data
- First name, last name, email, phone
- Company name (if provided)
- Full address including country and country code
- Shopify customer ID, total orders, total spent
- Account creation date, tags, and notes
- Marketing consent status
Customers are created as leads in LeadMachine with email and phone saved as contacts.
Order Data
- Order number, date, total price, subtotal, tax, shipping, currency
- Financial status (paid, pending, refunded, etc.)
- Fulfillment status (fulfilled, partial, unfulfilled, etc.)
- Discount codes used
- Referring site (traffic source)
- Source name (web, POS, mobile, etc.)
- Cancelled date (if applicable)
- All line items stored individually with product ID, variant, SKU, quantity, price, and discount
Test orders from Shopify are captured but automatically excluded from all KPIs, segments, and RFM scoring.
Real-Time Webhooks
Once connected, LeadMachine registers webhooks for instant updates:
- customers/create — new customer added
- customers/update — customer info changed
- customers/marketing_consent_update — marketing opt-in/out changed
- orders/create — new order placed
- orders/updated — order status changed
- refunds/create — refund issued (creates a follow-up task)
- checkouts/create and checkouts/update — abandoned checkout tracking
- app/uninstalled — automatically soft-deletes the connection
All webhooks are HMAC-verified for security.
Smart Auto-Tagging
LeadMachine automatically applies tags based on customer behavior. Tags are applied during sync, webhooks, and order processing.
Behavior-Based Tags
- Customer — has placed at least one order
- Newsletter — no orders yet but accepts marketing emails
- New Customer — exactly 1 order, placed within the last 7 days
- VIP — 3+ orders AND total spend is 2x or more the company average
- High Value — total spend is 3x or more the company average
- Abandoned Cart — started checkout but didn't complete (automatically removed when they complete the order)
Tag Transitions
- Newsletter subscriber makes a purchase: gets "Customer" tag added, keeps "Newsletter"
- New customer places more orders over time: "New Customer" tag is replaced by VIP or High Value when thresholds are met
- Abandoned checkout is completed: "Abandoned Cart" tag is automatically removed
Tags persist across syncs and can be manually removed, but will be re-applied on the next sync if conditions still apply.
Using Tags for Segmentation
- Filter by Newsletter to find subscribers who haven't purchased — send first-purchase incentives
- Filter by VIP to identify your best customers — create loyalty campaigns
- Filter by Abandoned Cart to see open recovery opportunities
- Combine tags with other filters for precise targeting
RFM Scoring
LeadMachine scores every Shopify customer using Recency, Frequency, and Monetary analysis. Scores are recomputed nightly.
How It Works
Each customer gets a score from 1-5 on three dimensions:
- Recency — how recently they last ordered
- Frequency — how many orders they've placed
- Monetary — how much they've spent in total
Scores are relative to your company's own customer base using percentile breakpoints (20th/40th/60th/80th), so a "5" means top 20% for that dimension.
Customer Segments
Based on the combined RFM score, customers are assigned a segment:
| Segment | Criteria | What It Means |
| --- | --- | --- |
| Champion | R>=4, F>=4, M>=4 | Recent, frequent, high-spending |
| Loyal | F>=3, M>=3 | Regular buyers with solid spend |
| New | R>=4, F<=2 | Recently acquired, early in journey |
| At Risk | R<=2, F>=3 | Used to buy often, gone quiet |
| Lost | R<=2, F<=2 | Haven't bought in a long time |
| Promising | R>=3, avg>=3 | Showing potential, worth nurturing |
| Average | Fallback | Everyone else |
| Event | Task | Priority |
| --- | --- | --- |
| First order | "Welcome new Shopify customer [name]" | Normal |
| High-value order (2x+ company average) | "High-value order from [name]" | High |
| Abandoned checkout | "Follow up on abandoned checkout from [email]" | Normal |
| Refund issued | "Review Shopify refund for order #[number]" | High |
| Segment | Definition | |
| --- | --- | |
| VIP Candidate | 3+ orders and spend >= 2x company average | |
| At Risk | Has ordered before but nothing in 60+ days | |
| Rising Star | 2+ orders in the last 30 days | |
| One-and-Done | Exactly 1 order, placed 30+ days ago |
Click any customer in a segment to view their full profile.
Persistent Ledo Chat
The welcome page includes a Ledo chat with saved conversation history. Your last 50 messages load when you open the page, and Ledo uses the last 20 as context. This is different from the embedded Shopify dashboard where chat is ephemeral.
The chat is rate-limited to 30 messages per minute and has full CRM action capabilities (tagging, notes, tasks, status changes).
Feature Integration Status
A panel shows which automation features are enabled or disabled for your company:
- Auto-create deals from orders
- Auto-create tasks from events
- Auto-enrich new customers
Managing Multiple Stores
Connect Additional Stores
- Go to Company Settings > Integrations
- Click Connect Another Store
- Follow the same authorization process
- Each store syncs independently
All customers go into the same lead database. If the same customer exists in multiple stores, LeadMachine matches by email and updates the existing lead rather than creating a duplicate. Order history shows orders from all connected stores.
Disconnect a Store
- Find your store in the Connected Stores card
- Click the three-dot menu and select Disconnect Store
- Confirm in the modal
On disconnect:
- A final sync captures the latest data
- The access token is securely removed
- All webhooks are deleted from Shopify
- Existing leads and orders remain in your database
- Source shows "Shopify - Store Name (Disconnected)"
- You can reconnect at any time
If the Shopify app is uninstalled from within Shopify admin, the connection is automatically soft-deleted.
Troubleshooting
Connection Issues
Can't connect to Shopify
- Verify your store URL is correct
- Make sure you're logged into Shopify with install permissions
- Clear browser cache and try again
Login loop in embedded dashboard
- First-time setup requires logging in — this is normal
- After login you should be redirected to Shopify OAuth
- If redirect fails, click the "Connect to Shopify" button that appears
- The embedded app uses token-based auth to handle third-party cookie restrictions
Connection lost
- Check if the app was uninstalled in Shopify (triggers automatic disconnect)
- Verify the connection in Company Settings > Integrations
- Reconnect the store if needed
Sync Issues
Customers not syncing
- Check connection status in Integrations
- Try a manual sync
- Verify webhooks are registered in Shopify admin under Settings > Notifications
Orders missing
- Ensure the order has customer data attached
- Check if it's a test order (test orders are synced but excluded from KPIs)
- Try manual sync
Duplicate leads
- LeadMachine matches by email — different emails create separate leads
- Merge duplicates manually from the Leads page
Data Questions
Why don't I see lead scores or RFM scores?
- Both lead scoring and RFM scoring run nightly — scores appear after the first overnight computation
- New stores need at least one night after connecting
- Leads enriched during the day are scored immediately after enrichment
Briefings not showing up?
- The briefing engine runs every 15 minutes
- Briefings require enough order history to detect patterns
- Check if briefings were dismissed — they won't repeat for the same customer within 7 days
Auto-tasks or auto-deals not creating?
- Verify the features are enabled in your company settings
- These only trigger on new webhook events, not during manual sync
FAQ
Q: Will this sync all my historical customers? A: Yes, the initial sync imports all existing customers and orders. After that, syncs are incremental.
Q: How often does data sync? A: Real-time via webhooks for new and updated customers, orders, checkouts, and consent changes. Manual sync available anytime.
Q: What are the auto-tags and how do they work? A: LeadMachine applies Customer, Newsletter, New Customer, VIP, High Value, and Abandoned Cart tags automatically based on purchase behavior and marketing consent. See the Smart Auto-Tagging section for thresholds.
Q: How does RFM scoring work? A: Customers are scored 1-5 on Recency, Frequency, and Monetary value relative to your company's customer base. Scores update nightly and place customers into segments like Champion, Loyal, At Risk, etc.
Q: What happens if I disconnect? A: Syncing stops but all existing lead and order data remains. You can reconnect anytime.
Q: Can I remove auto-tags? A: Yes, but they'll be re-applied on the next sync if the conditions still apply.
Q: Does this work with Shopify Plus? A: Yes, works with all Shopify plans.
Q: Are there additional costs? A: No additional costs from LeadMachine. Standard Shopify API usage applies.
Q: Will this slow down my Shopify store? A: No. The integration uses webhooks which don't impact store performance.
Q: How does marketing consent sync work? A: Bi-directionally. Unsubscribes in Shopify propagate to LeadMachine campaigns, and unsubscribes in LeadMachine push back to Shopify.
Q: What happens with abandoned checkouts? A: They're tracked automatically. The customer is tagged "Abandoned Cart" and optionally gets a follow-up task. When they complete the purchase, the tag is removed.
Q: Can I control which automations are active? A: Yes. Auto-deal creation, auto-tasks, and auto-enrichment are each toggled independently in your company settings.