Shopify Integrationsleitfaden
Dieser umfassende Leitfaden fuehrt Sie durch die Integration von Tajo mit Ihrem Shopify-Shop, um leistungsstarke Funktionen fuer Kundenengagement, Treueprogramme und Marketing-Automatisierung freizuschalten.
Ueberblick
Die Tajo-Shopify-Integration ermoeglicht Ihnen:
- Kundendaten automatisch synchronisieren aus Ihrem Shopify-Shop
- Bestellungen und Produkte verfolgen fuer personalisiertes Marketing
- Treueprogramme betreiben mit Punkten, Stufen und Praemien
- Marketingkampagnen automatisieren ueber Brevo (E-Mail, SMS, WhatsApp)
- Kunden segmentieren nach Kaufverhalten und Engagement
- Abgebrochene Warenkoerbe wiederherstellen mit automatisierten Sequenzen
Voraussetzungen
Bevor Sie mit der Integration beginnen, stellen Sie sicher, dass Sie haben:
- Shopify-Shop auf einem beliebigen Tarif (Basic, Shopify, Advanced oder Plus)
- Tajo-Konto mit einem aktiven Abonnement
- Brevo-Konto (optional, fuer Marketing-Automatisierung)
- Admin-Zugriff auf Ihren Shopify-Shop
Schritt 1: Tajo-App installieren
Aus dem Shopify App Store
- Gehen Sie zum Shopify App Store
- Suchen Sie nach “Tajo”
- Klicken Sie auf App hinzufuegen
- Ueberpruefen Sie die Berechtigungen und klicken Sie auf App installieren
- Sie werden zum Tajo-Einrichtungsassistenten weitergeleitet
Manuelle Installation
Falls Sie eine manuelle Einrichtung bevorzugen:
# Tajo Shopify App klonengit clone https://github.com/tajo/shopify-app.git
# Abhaengigkeiten installierencd shopify-appnpm install
# Umgebung konfigurierencp .env.example .envKonfigurieren Sie Ihre .env-Datei:
SHOPIFY_API_KEY=your_api_keySHOPIFY_API_SECRET=your_api_secretSHOPIFY_SCOPES=read_customers,write_customers,read_orders,read_productsTAJO_API_KEY=your_tajo_api_keyBREVO_API_KEY=your_brevo_api_keySchritt 2: Datensynchronisation konfigurieren
Kundensynchronisations-Einstellungen
Konfigurieren Sie in Ihrem Tajo-Dashboard, welche Kundendaten synchronisiert werden:
{ "sync_settings": { "customers": { "enabled": true, "sync_frequency": "real-time", "fields": [ "email", "first_name", "last_name", "phone", "accepts_marketing", "tags", "total_spent", "orders_count", "created_at", "addresses" ] }, "orders": { "enabled": true, "sync_frequency": "real-time", "include_line_items": true, "include_fulfillments": true }, "products": { "enabled": true, "sync_frequency": "hourly", "include_variants": true, "include_images": true } }}Webhook-Konfiguration
Tajo registriert automatisch diese Shopify-Webhooks:
| Webhook | Zweck |
|---|---|
customers/create | Neue Kunden zu Tajo & Brevo synchronisieren |
customers/update | Kundenprofile aktuell halten |
orders/create | Kaeufe verfolgen, Treuepunkte vergeben |
orders/paid | Nachkauf-Kampagnen ausloesen |
orders/fulfilled | Versandbenachrichtigungen senden |
carts/create | Warenkorbabbruch-Daten verfolgen |
carts/update | Warenkorbabbruch-Sequenzen aktualisieren |
products/update | Produktkatalog synchron halten |
Erstmaliger Datenimport
Fuer bestehende Shops importieren Sie historische Daten:
// Bestehende Kunden importierenasync function importShopifyCustomers() { const shopify = new Shopify({ shopName: process.env.SHOP_NAME, apiKey: process.env.SHOPIFY_API_KEY, password: process.env.SHOPIFY_PASSWORD });
let customers = []; let params = { limit: 250 };
do { const batch = await shopify.customer.list(params); customers = customers.concat(batch); params = batch.nextPageParameters; } while (params);
// Zu Tajo synchronisieren for (const customer of customers) { await tajo.customers.upsert({ email: customer.email, firstName: customer.first_name, lastName: customer.last_name, phone: customer.phone, totalSpent: customer.total_spent, ordersCount: customer.orders_count, tags: customer.tags, source: 'shopify', externalId: customer.id }); }
console.log(`${customers.length} Kunden importiert`);}Schritt 3: Treueprogramm einrichten
Punktesystem konfigurieren
Definieren Sie, wie Kunden Punkte sammeln:
const pointsConfig = { // Punkte pro ausgegebenem Dollar purchasePoints: { enabled: true, rate: 1, // 1 Punkt pro $1 roundingMode: 'floor' },
// Bonusaktionen bonusPoints: { accountCreation: 100, firstPurchase: 200, reviewSubmitted: 50, referralMade: 500, birthdayBonus: 100, socialShare: 25 },
// Stufen-Multiplikatoren tierMultipliers: { Bronze: 1.0, Silver: 1.25, Gold: 1.5, Platinum: 2.0 }};Treuestufen definieren
const loyaltyTiers = [ { name: 'Bronze', minPoints: 0, benefits: [ '1 Punkt pro $1 Ausgabe', 'Geburtstags-Bonuspunkte', 'Exklusive Mitglieder-Aktionen' ] }, { name: 'Silver', minPoints: 1000, benefits: [ '1,25x Punkte-Multiplikator', 'Kostenloser Versand ab $50', 'Fruehzeitiger Zugang zu Sales' ] }, { name: 'Gold', minPoints: 5000, benefits: [ '1,5x Punkte-Multiplikator', 'Kostenloser Versand bei allen Bestellungen', 'Exklusiver Produktzugang', 'Prioritaets-Kundensupport' ] }, { name: 'Platinum', minPoints: 15000, benefits: [ '2x Punkte-Multiplikator', 'Kostenloser Expressversand', 'VIP-Erlebnisse', 'Persoenlicher Einkaufsberater', 'Jaehrliches Geschenk' ] }];Praemienkatalog erstellen
const rewards = [ { id: 'discount_5', name: '$5 Rabatt', pointsCost: 500, type: 'fixed_discount', value: 5, minPurchase: 25 }, { id: 'discount_10', name: '$10 Rabatt', pointsCost: 900, type: 'fixed_discount', value: 10, minPurchase: 50 }, { id: 'percent_10', name: '10% Rabatt', pointsCost: 750, type: 'percentage_discount', value: 10, maxDiscount: 50 }, { id: 'free_shipping', name: 'Kostenloser Versand', pointsCost: 300, type: 'free_shipping' }, { id: 'free_product', name: 'Gratisgeschenk', pointsCost: 2000, type: 'free_product', productId: 'gid://shopify/Product/123456' }];Schritt 4: Warenkorbabbruch-Wiederherstellung
Warenkorb-Tracking konfigurieren
// Warenkorb-Aktualisierungen verfolgenshopify.webhooks.on('carts/update', async (cart) => { if (cart.line_items.length === 0) return;
const customer = await getCustomerByCart(cart); if (!customer?.email) return;
await tajo.carts.track({ customerId: customer.id, cartToken: cart.token, items: cart.line_items.map(item => ({ productId: item.product_id, variantId: item.variant_id, title: item.title, quantity: item.quantity, price: item.price, image: item.image })), totalPrice: cart.total_price, currency: cart.currency, checkoutUrl: cart.checkout_url });});Wiederherstellungssequenz einrichten
{ "abandoned_cart_sequence": { "trigger": { "event": "cart_abandoned", "delay": "1 hour" }, "emails": [ { "delay": "1 hour", "channel": "email", "template": "cart_reminder_1", "subject": "Sie haben etwas vergessen!" }, { "delay": "24 hours", "channel": "email", "template": "cart_reminder_2", "subject": "Ihr Warenkorb wartet - 10% Rabatt inklusive" }, { "delay": "72 hours", "channel": "sms", "template": "cart_sms_final", "message": "Letzte Chance! Ihr Warenkorb laeuft bald ab. Bestellung abschliessen: {{checkout_url}}" } ], "exit_conditions": [ "order_completed", "cart_emptied", "unsubscribed" ] }}Schritt 5: Marketing-Automatisierung mit Brevo
Kundensegmente
Erstellen Sie leistungsstarke Segmente basierend auf Shopify-Daten:
const shopifySegments = [ // Kaufverhalten { name: 'Erstkaeufer', conditions: { orders_count: 1 } }, { name: 'Stammkunden', conditions: { orders_count: { $gte: 2 } } }, { name: 'VIP-Kunden', conditions: { total_spent: { $gte: 500 } } }, { name: 'Gefaehrdete Kunden', conditions: { last_order_date: { $lt: '90 days ago' }, orders_count: { $gte: 2 } } },
// Produktinteresse { name: 'Kategorie: Elektronik', conditions: { purchased_categories: { $contains: 'Electronics' } } },
// Engagement { name: 'Warenkorbabbrecher', conditions: { has_abandoned_cart: true } }, { name: 'Browser-Abbrecher', conditions: { viewed_products: { $gte: 3 }, orders_count: 0 } }];Automatisierte Kampagnen-Trigger
// Bestellbestaetigung + Upsellshopify.webhooks.on('orders/paid', async (order) => { const customer = await tajo.customers.get(order.customer.id);
// Kundenstatistiken aktualisieren await tajo.customers.update(customer.id, { totalSpent: customer.totalSpent + order.total_price, ordersCount: customer.ordersCount + 1, lastOrderDate: order.created_at });
// Treuepunkte vergeben const pointsEarned = calculatePoints(order, customer); await tajo.loyalty.awardPoints(customer.id, pointsEarned, { reason: 'purchase', orderId: order.id });
// An Brevo fuer Kampagnen senden await brevo.trackEvent(customer.email, 'order_completed', { order_id: order.id, order_total: order.total_price, points_earned: pointsEarned, loyalty_tier: customer.loyaltyTier, products: order.line_items.map(i => i.title).join(', ') });});
// Nachkauf-Bewertungsanfrageconst reviewRequestCampaign = { trigger: 'order_delivered', delay: '7 days', template: 'review_request', conditions: { customer_tags: { $not: { $contains: 'no-review-request' } } }};
// Rueckgewinnungskampagneconst winBackCampaign = { trigger: 'customer_inactive', conditions: { last_order_date: '90 days ago', orders_count: { $gte: 1 } }, sequence: [ { delay: '0', template: 'we_miss_you', offer: '15% Rabatt' }, { delay: '7 days', template: 'win_back_2', offer: '20% Rabatt' }, { delay: '14 days', template: 'final_offer', offer: '25% Rabatt' } ]};Schritt 6: Produktempfehlungen
Empfehlungsmaschine konfigurieren
const recommendationConfig = { algorithms: [ { name: 'frequently_bought_together', weight: 0.3 }, { name: 'similar_products', weight: 0.25 }, { name: 'customer_also_viewed', weight: 0.2 }, { name: 'trending_in_category', weight: 0.15 }, { name: 'personalized_for_you', weight: 0.1 } ], filters: { exclude_purchased: true, exclude_out_of_stock: true, min_rating: 3.5 }};
// Empfehlungen fuer E-Mail abrufenasync function getEmailRecommendations(customerId, limit = 4) { const customer = await tajo.customers.get(customerId); const recentOrders = await tajo.orders.list({ customerId, limit: 5 });
return await tajo.recommendations.get({ customerId, purchaseHistory: recentOrders, browsingHistory: customer.recentlyViewed, limit, algorithms: recommendationConfig.algorithms });}Schritt 7: Analysen & Berichte
Wichtige Kennzahlen-Dashboard
const dashboardMetrics = { // Kundenkennzahlen customers: { total: await tajo.analytics.count('customers'), new_this_month: await tajo.analytics.count('customers', { created_at: { $gte: 'this_month' } }), returning_rate: await tajo.analytics.returningCustomerRate() },
// Umsatzkennzahlen revenue: { total: await tajo.analytics.sum('orders.total'), average_order_value: await tajo.analytics.avg('orders.total'), revenue_per_customer: await tajo.analytics.revenuePerCustomer() },
// Treuekennzahlen loyalty: { active_members: await tajo.analytics.count('loyalty_members', { status: 'active' }), points_issued: await tajo.analytics.sum('points.awarded'), points_redeemed: await tajo.analytics.sum('points.redeemed'), redemption_rate: await tajo.analytics.pointsRedemptionRate() },
// Kampagnenkennzahlen campaigns: { emails_sent: await brevo.analytics.emailsSent('this_month'), open_rate: await brevo.analytics.openRate('this_month'), click_rate: await brevo.analytics.clickRate('this_month'), revenue_attributed: await tajo.analytics.campaignRevenue('this_month') }};Fehlerbehebung
Haeufige Probleme
Webhook-Zustellungsfehler
// Shopify Webhook-Signatur ueberpruefenfunction verifyShopifyWebhook(req) { const hmac = req.headers['x-shopify-hmac-sha256']; const body = req.rawBody; const hash = crypto .createHmac('sha256', process.env.SHOPIFY_WEBHOOK_SECRET) .update(body) .digest('base64');
return crypto.timingSafeEqual( Buffer.from(hash), Buffer.from(hmac) );}Synchronisationskonflikte
// Doppelte Kunden behandelnasync function resolveCustomerConflict(shopifyCustomer, tajoCustomer) { // Daten zusammenfuehren, neueste Aktualisierungen bevorzugen const merged = { ...tajoCustomer, email: shopifyCustomer.email, firstName: shopifyCustomer.first_name || tajoCustomer.firstName, lastName: shopifyCustomer.last_name || tajoCustomer.lastName, phone: shopifyCustomer.phone || tajoCustomer.phone, // Tajo-Treuedaten beibehalten loyaltyPoints: tajoCustomer.loyaltyPoints, loyaltyTier: tajoCustomer.loyaltyTier };
return await tajo.customers.update(tajoCustomer.id, merged);}Ratenbegrenzung
// Exponentielles Backoff implementierenasync function shopifyApiCall(fn, retries = 3) { for (let i = 0; i < retries; i++) { try { return await fn(); } catch (error) { if (error.code === 429 && i < retries - 1) { const delay = Math.pow(2, i) * 1000; await new Promise(r => setTimeout(r, delay)); continue; } throw error; } }}Naechste Schritte
- Brevo-Integration konfigurieren fuer E-Mail-/SMS-Kampagnen
- Webhooks einrichten fuer Echtzeit-Events
- Kundensegmente erstellen fuer gezieltes Marketing
- E-Mail-Vorlagen erstellen fuer automatisierte Kampagnen
Support
- Integrations-Support: [email protected]
- Shopify-Dokumentation: shopify.dev
- API-Referenz: docs.tajo.io/api
- Community-Forum: community.tajo.io