Shopify Connector

Shopify Connector

Connect your Shopify store to Brevo for complete customer data synchronization, abandoned cart recovery, and automated marketing campaigns.

Overview

PropertyValue
PlatformShopify
CategoryE-commerce
Setup ComplexityEasy
Official IntegrationYes
Data SyncedCustomers, Orders, Products, Carts, Events
Available Skills12

Features

  • Real-time customer sync - Customer data synced instantly to Brevo contacts
  • Order tracking - Order events for post-purchase flows
  • Product catalog sync - Products available for recommendations
  • Cart abandonment - Track and recover abandoned carts
  • Browse behavior - Page view and product interest tracking
  • Multi-store support - Connect multiple Shopify stores

Prerequisites

Before you begin, ensure you have:

  1. A Shopify store with admin access
  2. A Brevo account with API access
  3. A Tajo account

Installation

  1. Visit the Tajo app in Shopify App Store
  2. Click “Add app”
  3. Grant requested permissions
  4. Connect your Brevo account

Option 2: Manual Installation

Step 1: Create a Shopify App

  1. Go to your Shopify admin → Settings → Apps and sales channels
  2. Click “Develop apps” → “Create an app”
  3. Name it “Tajo Integration”

Step 2: Configure API Scopes

Enable these scopes:

read_customers
write_customers
read_orders
read_products
read_checkouts
write_script_tags

Step 3: Install the App

Terminal window
# Using Tajo CLI
tajo connectors install shopify \
--shop-url your-store.myshopify.com \
--api-key $SHOPIFY_API_KEY \
--api-secret $SHOPIFY_API_SECRET

Step 4: Configure Webhooks

Tajo automatically registers these webhooks:

WebhookPurpose
customers/createNew customer sync
customers/updateCustomer data changes
customers/deleteCustomer removal
orders/createOrder placed events
orders/updatedOrder status changes
checkouts/createCart created
checkouts/updateCart updated

Configuration

Basic Setup

connectors:
shopify:
enabled: true
shop_url: "your-store.myshopify.com"
api_version: "2024-01"
# Data sync options
sync:
customers: true
orders: true
products: true
carts: true
inventory: false # Optional
# List assignment
lists:
all_customers: 5
buyers: 6
abandoned_cart: 7

Field Mapping

Map Shopify fields to Brevo contact attributes:

Default Mappings

Parameter Type Description
email required
string

Customer email (unique identifier)

first_name optional
string

Maps to FIRSTNAME attribute

last_name optional
string

Maps to LASTNAME attribute

phone optional
string

Maps to SMS attribute for WhatsApp/SMS

accepts_marketing optional
boolean

Controls subscription status

orders_count optional
integer

Total number of orders

total_spent optional
number

Lifetime customer value

tags optional
array

Customer tags from Shopify

Custom Attribute Mapping

field_mapping:
# Standard fields
email: email
first_name: FIRSTNAME
last_name: LASTNAME
phone: SMS
# E-commerce metrics
orders_count: ORDER_COUNT
total_spent: TOTAL_SPENT
last_order_date: LAST_ORDER_DATE
# Custom fields
customer_type: CUSTOMER_TYPE
preferred_language: LANGUAGE
loyalty_tier: VIP_TIER
# Computed fields
average_order_value: AOV
days_since_last_order: RECENCY

Product Sync

Sync products for email recommendations:

sync:
products:
enabled: true
include_variants: true
include_images: true
categories_as_tags: true
# Filter products
filter:
status: active
exclude_tags: ["hidden", "wholesale-only"]

Inventory Tracking

Enable stock-level synchronization:

sync:
inventory:
enabled: true
low_stock_threshold: 10
out_of_stock_events: true

Events

Customer Events

EventTriggerUse Case
customer_createdNew customer signupWelcome series
customer_updatedProfile changesData sync
customer_tags_addedTags assignedSegment updates

Order Events

EventTriggerUse Case
order_placedCheckout completeOrder confirmation
order_fulfilledOrder shippedShipping notification
order_cancelledOrder cancelledCancellation email
order_refundedRefund processedRefund confirmation

Cart Events

EventTriggerUse Case
cart_createdItems added to cartBrowse tracking
cart_updatedCart modifiedCart value tracking
cart_abandonedNo checkout in 30minRecovery emails

Skills Enabled

The Shopify connector enables these skills:

SkillDescription
Customer SyncReal-time customer sync
Order EventsOrder lifecycle tracking
Abandoned CartCart recovery emails
Welcome SeriesNew customer onboarding
Post-PurchaseOrder follow-up
Win-BackRe-engage inactive customers
Browse AbandonmentProduct interest follow-up
ReplenishmentReorder reminders

Code Examples

Initialize Connector

import { TajoClient } from '@tajo/sdk';
const tajo = new TajoClient({
apiKey: process.env.TAJO_API_KEY,
brevoApiKey: process.env.BREVO_API_KEY
});
// Connect Shopify store
await tajo.connectors.connect('shopify', {
shopUrl: 'your-store.myshopify.com',
apiKey: process.env.SHOPIFY_API_KEY,
apiSecret: process.env.SHOPIFY_API_SECRET
});

Run Initial Sync

// Full historical sync
await tajo.connectors.sync('shopify', {
type: 'full',
resources: ['customers', 'orders', 'products'],
since: '2023-01-01'
});
// Check sync status
const status = await tajo.connectors.status('shopify');
console.log(status);
// {
// connected: true,
// lastSync: '2024-01-15T10:30:00Z',
// customersCount: 15420,
// ordersCount: 8234,
// productsCount: 342
// }

Track Cart Events

Add the Tajo script to your Shopify theme:

<!-- Add to theme.liquid before </head> -->
{% if customer %}
<script>
window.tajoConfig = {
customerId: "{{ customer.id }}",
customerEmail: "{{ customer.email }}",
customerName: "{{ customer.first_name }}"
};
</script>
{% endif %}
<script src="https://cdn.tajo.io/shopify.js"></script>

Custom Webhook Handler

// Handle Shopify webhooks manually
app.post('/webhooks/shopify', async (req, res) => {
const hmac = req.get('X-Shopify-Hmac-SHA256');
// Verify webhook signature
if (!verifyShopifyWebhook(req.body, hmac)) {
return res.status(401).send('Unauthorized');
}
const topic = req.get('X-Shopify-Topic');
// Forward to Tajo
await tajo.connectors.handleWebhook('shopify', {
topic,
payload: req.body
});
res.status(200).send('OK');
});

Monitoring

Dashboard Metrics

Monitor your Shopify connection in the Tajo dashboard:

  • Sync Status: Real-time connection health
  • Customers Synced: Total contacts from Shopify
  • Orders Tracked: Order events processed
  • Cart Recovery: Abandoned cart performance
  • Error Rate: Failed sync attempts

Webhook Logs

View webhook delivery status:

Terminal window
tajo connectors logs shopify --type webhook --last 24h

Sync History

Check historical sync operations:

Terminal window
tajo connectors history shopify --limit 10

Troubleshooting

Common Issues

API Rate Limits

Shopify has API rate limits of 2 requests/second. Use batch sync for large historical imports.

IssueCauseSolution
Webhook not receivedApp permissionsReinstall app with correct scopes
Customer not syncedMissing emailShopify requires email for customers
Products missingProduct statusCheck product is “active” status
Cart not trackedScript not loadedVerify script in theme.liquid

Debug Mode

Enable verbose logging:

connectors:
shopify:
debug: true
log_level: verbose
log_webhooks: true

Test Connection

Terminal window
tajo connectors test shopify
# ✓ API connection successful
# ✓ Webhooks registered
# ✓ Products accessible
# ✓ Customers readable
# ✓ Orders readable

Best Practices

  1. Start with test store - Use a development store first
  2. Run initial sync during off-hours - Large syncs can be slow
  3. Map custom attributes - Don’t rely on default mappings only
  4. Enable cart tracking - Critical for abandoned cart recovery
  5. Monitor webhook health - Set up alerts for failed deliveries
  6. Use batch imports - For historical data over 10,000 records

Security

  • OAuth 2.0 - Secure token-based authentication
  • Webhook verification - HMAC signature validation
  • Encrypted storage - API credentials encrypted at rest
  • Scoped access - Minimum required permissions only
AI асистент

Здравейте! Попитайте ме за документацията.

Започнете безплатно с Brevo