AI Automation For E-commerce Flow
This is your guide to building a powerful AI-driven sales engine for your e-commerce store, with step-by-step setup for Shopify, WooCommerce, and Google Sheets. We will create three specialized AI agents in ABC Sales Bot to handle the entire customer lifecycle:
- Product Suggestion AI: Acts as a 24/7 sales assistant on your website, helping customers find the perfect product
- Cart Recovery AI: An automated system to win back customers who abandon their shopping carts (with a primary focus on Shopify)
- Post-Purchase AI: A customer service agent that handles order confirmations, shipping updates, and follow-ups
By the end of this guide, you will have a fully automated system that engages visitors, recovers lost sales, and nurtures customers, all through WhatsApp.
The Big Picture: The E-commerce Customer Journey
Before we dive in, let's visualize the flow. This is how a customer will interact with your AI system at every stage:
- A lead arrives from your website chat widget
- The Product Suggestion AI and Default Automation engage them
- The customer adds a product to their cart
- Path A (Purchase): They complete the purchase and move to the Post-Purchase AI and automation
- Path B (Abandonment, Shopify): They abandon the cart, the Cart Recovery AI and automation win them back, and once they buy they move to the Post-Purchase AI
Phase 1: Foundation & Pre-Setup
These foundational steps are critical. Do not skip them.
1. Critical Pre-Setup Checklist
- Connect WhatsApp: Ensure your WhatsApp number is connected to the ABC Sales Bot platform
- Admin Access: You will need administrator access to your e-commerce platform (Shopify or WooCommerce) and your ABC Sales Bot account
- Gather AI Training Materials: Collect links to your main product pages, FAQ section, and any pages detailing your shipping and return policies
2. Create Essential Custom Fields for Cart Recovery
This step is crucial for the Shopify abandoned cart flow.
- In ABC Sales Bot, navigate to Settings, then Custom Fields
- Click "Add Custom Field" and create these two fields:
- Field Name:
items_in_cart(Type: Text) - Field Name:
checkout_url(Type: Text)
These fields will store the specific products a customer left in their cart and the direct link to complete their purchase.
Phase 2: The "Product Suggestion AI" - Your Digital Sales Rep
This is the first AI your customers will meet. It lives on your website via a chat widget and helps users find what they need by querying your product database in real time.
1. Create the AI Agent
- In ABC Sales Bot, go to AI Agents and click "Create Agent"
- Name it "Product Suggestion AI"
- In the "System Prompt" section, provide the AI with your store's context (policies, brand story, etc.)
- You can also provide an SOP on which questions it should ask the client first
Option B: Use our custom GPT at salesbotsecrets.com/aitemplate to process your raw materials (like your 'About Us' page and policy pages) into a powerful, well-structured system prompt.
2. Connect Your Product Database (Choose One)
The Product Suggestion AI needs a way to search your inventory. This is done by adding a Custom Tool to the agent. Choose the guide that matches your store's platform.
A) For Shopify Stores
Your AI can search your Shopify products without complex authentication using the public search API. Follow the step-by-step guide: Integrating Shopify's Public Search API as a Custom Tool. It shows you how to create a query_shopify_info tool the AI can use to find products, prices, and create direct product links.
B) For WooCommerce Stores
You will generate read-only API keys from your WordPress dashboard to allow the AI to securely search your products. Follow the step-by-step guide: How to Integrate Your WooCommerce Store with ABC Sales AI. It walks you through creating API keys and setting up a query_product_info tool.
C) For Stores Using Google Sheets as a Database
If you manage your products in a Google Sheet, you can create a simple API to let the AI search it. Follow the step-by-step guide: How To Use AI To Search Google Sheet For Data To Answer Clients. It explains how to deploy a script and create a Search_Sheet tool.
Phase 3: The "Default Automation" - Engaging New Visitors
When a new visitor starts a chat on your website, they should be automatically entered into an engagement sequence.
- Navigate to the Automations section in ABC Sales Bot and create a new flow. Name it "Default Welcome Flow"
- In the automation's settings, assign the Product Suggestion AI to it
- Set as Default: Click "Edit" on the automation and toggle on the "Set as default" option. This ensures any new lead who messages you is automatically added to this flow
- Build the Message Sequence (see below)
Build the sequence like this:
- Step 1: Delay. Add a Wait step and set it for 5 minutes. This prevents the message from seeming too robotic
- Step 2: First Message. Add a Send Message step. Craft a message designed to help the user make a decision. Example: "Hi {{name}}, thanks for visiting! I'm here to help you find the perfect product. What are you looking for today?"
- Steps 3 & 4: Follow-up Nudges. Add 2-3 more messages with delays (e.g., 24 hours). Use these to offer helpful tips, share customer reviews (social proof), or ask clarifying questions to re-engage them
You can use the custom GPT at salesbotsecrets.com/bookingtemplate to help you craft a compelling follow-up sequence.
Phase 4: The "Cart Recovery AI" - Saving Lost Sales (Shopify)
This flow is the most powerful way to recover revenue and is triggered via Zapier when a customer abandons a cart in Shopify.
1. Create the Cart Recovery AI & Automation
- In AI Agents, create a new agent named "Cart Recovery AI". Train it with prompts focused on overcoming purchase hesitation (e.g., offering help, mentioning a limited-time discount)
- In Automations, create a new flow named "Shopify Abandoned Cart". Assign the Cart Recovery AI to this automation
- Design the Message Template: In the automation, create the message that will be sent, using the custom fields you made earlier. Example: "Hi {{name}}, we noticed you left some items in your cart! You were so close to getting your hands on: {{items_in_cart}}. Is there anything I can help with? You can complete your purchase right here: {{checkout_url}}"
2. Configure the Zapier Flow
- Log in to Zapier and create a new Zap
- Trigger: Shopify - New Abandoned Cart. Choose the "Shopify" app, select the "New Abandoned Cart" trigger, connect your Shopify account, and test the trigger to pull in a sample abandoned cart
- Action: ABC Sales AI - Create or Update Lead. Choose the "ABC Sales AI" app, select the "Create or Update Lead" action, and connect your account using your API key
- Map the Fields (this is the most important part, see below)
- Turn on your Zap!
Field mapping:
- Phone/Email: Map the customer's contact info from the Shopify trigger
- Custom Field
items_in_cart: Map the "Line Items Name" field from the Shopify trigger - Custom Field
checkout_url: Map the "Abandoned Checkout URL" field from the Shopify trigger - Automation to Add: Paste the unique ID of your "Shopify Abandoned Cart" automation from ABC Sales Bot
Note for WooCommerce users: A native abandoned cart trigger is not standard in WooCommerce. This flow requires a specific plugin that can send a webhook when a cart is abandoned. If you have such a plugin, you can use a "Catch Webhook" trigger in Zapier to achieve a similar result.
Phase 5: The "Post-Purchase AI" - Nurturing Customers
Once a customer buys, move them to a new automation to handle post-sale communication.
1. Create the Post-Purchase AI & Automation:
- Create an agent named "Post-Purchase AI" trained on shipping info, return policies, and asking for reviews
- Create an automation named "Post-Purchase Flow" and assign the new AI to it
- Build a message sequence for order confirmation, shipping updates, and a final message a week later asking for a product review
2. Set Up the Trigger (via Zapier/Webhook):
- Create a new Zap or workflow
- Trigger: Use "New Order" in Shopify or "New Customer" in WooCommerce
- Action: Use the "Create or Update Lead" action in ABC Sales AI and map the customer's contact information
- Automation to Add: Paste the ID for your "Post-Purchase Flow"
- Automation to Remove: Paste the IDs for the "Default Welcome Flow" and "Shopify Abandoned Cart" automations. This is crucial to prevent conflicting messages
Phase 6: Going Live - Website Integration & Testing
Install the Chat Widget:
- In ABC Sales Bot, go to the Integrations tab
- Find the WhatsApp Button Generator section. You can customize the welcome message here
- Copy the provided code snippet and paste it into the HTML of your website before the closing
</body>tag
Test the Entire Flow:
- Go to your website and interact with the chat widget. Check that you are added to the "Default Welcome Flow" and that the AI can accurately provide details about products from your site
- (Shopify) Add an item to your cart, go to checkout, fill in your details, then close the page. Wait to see if the abandoned cart message arrives on your WhatsApp
- Complete a test purchase to ensure you are moved to the "Post-Purchase Flow"
- Review the conversations in ABC Sales Bot to see how the AI is performing and tweak the system prompts as needed
Troubleshooting & Overcoming Technical Challenges
Even with the best plan, you might face challenges. Here's a guide to solving the most common issues.
Challenge 1: The AI Isn't Capturing Information Correctly
- Problem: The AI chats with a customer but the
customer_interestfield remains empty - Cause: This usually happens for two reasons: the AI's instructions aren't specific enough, or the AI is using its judgment and didn't deem the information certain enough to save
- Refine Your AI Prompt: Make the instruction explicit. Change "Update the customer_interest field" to "You must always update the customer_interest field with the primary product category or need the user mentions in their first few messages."
- Supervise & Correct: In the early stages, manually review conversations in the inbox. If the AI missed something, you can manually update the custom field for that lead. This also helps you see patterns in how the AI misunderstands things
Challenge 2: Zapier Integration Isn't Working
- Problem: A customer abandons a cart on Shopify, but nothing happens in your app
- Cause: This is almost always an issue with the webhook configuration in Zapier
- Check the Zap History: In Zapier, go to "Zap History." Find the run that should have triggered. It will show you an error message. This is your biggest clue
- Verify the Webhook URL: Did you copy and paste the exact URL from the integration page? Even a single missing character will cause it to fail
- Check the JSON Payload: Is your data payload valid JSON? Use an online JSON validator to check for missing commas or brackets
- Verify Field Mapping: Look at the data that was sent in the Zap history. Is the phone number being passed correctly? Does it include the country code? Is the cart link field actually being populated with a URL from Shopify? Sometimes the test data in Zapier is different from live data
- Authentication: Ensure your API key is correctly entered in the "Authorization" or "Headers" section of the webhook action, exactly as shown in the integration guide
Challenge 3: Customers Receive the Wrong Messages
- Problem: A customer just bought an item but they receive an abandoned cart message
- Cause: The lead was not correctly moved from one automation to another. The "unsubscribe" action failed
- Check Your Zapier Logic: In the "New Purchase" Zap, double-check that you have an
unsubscribefield in your JSON payload pointing to the Slot ID of the "Abandoned Cart" automation - Examine the Lead's History: In ABC Salesbot, click on the lead's profile. You can see which automations they are currently enrolled in. This will confirm if the unsubscribe action failed
- Use the
replaceCommand: As a fail-safe, you can use thereplacecommand instead ofsubscribein your payload.replaceremoves the lead from all other automations and places them only in the one you specify. This is a more aggressive but very effective way to prevent message overlaps
Challenge 4: Phone Numbers Aren't Formatting Correctly
- Problem: Zapier sends a phone number like "555-123-4567," but WhatsApp needs a country code (e.g., +15551234567)
- Cause: Inconsistent phone number formatting from your e-commerce platform
- Use Zapier's Formatter: Add a "Formatter by Zapier" step to your Zap before the webhook. Choose Formatter, then Numbers, then Format Phone Number
- Configure It: Select the input phone number from your Shopify trigger and choose the desired format (E.164, the international standard with a '+')
- Map It: In your final webhook step, map this formatted phone number to the
phonefield in your payload
By methodically working through these steps and anticipating these common challenges, you can build an incredibly powerful and reliable AI-driven e-commerce engine that works for you 24/7.