WooCommerce Integrationsleitfaden
Dieser umfassende Leitfaden führt dich durch die Integration von Tajo mit deinem WooCommerce-Shop, damit du leistungsstarke Funktionen für Customer Engagement, Loyalty-Programme und Marketing-Automatisierung freischalten kannst.
Überblick
Mit der Tajo-WooCommerce-Integration kannst du:
- Kundendaten automatisch aus deinem WooCommerce-Shop synchronisieren
- Bestellungen und Produkte für personalisiertes Marketing verfolgen
- Loyalty-Programme mit Punkten, Tiers und Prämien betreiben
- Marketing-Kampagnen automatisieren über Brevo (E-Mail, SMS, WhatsApp)
- Kunden segmentieren nach Kaufverhalten und Engagement
- Verlassene Warenkörbe zurückgewinnen mit automatisierten Sequenzen
Voraussetzungen
Bevor du mit der Integration startest, stelle sicher, dass du Folgendes hast:
- WordPress-Site mit installiertem WooCommerce (Version 7.0+)
- Tajo-Konto mit aktivem Abonnement
- Brevo-Konto (optional, für Marketing-Automatisierung)
- Admin-Zugang zu deiner WordPress-Site
- PHP 7.4+ und WordPress 6.0+
Schritt 1: Tajo-Plugin installieren
Aus dem WordPress-Plugin-Verzeichnis
- Öffne dein WordPress-Admin-Dashboard
- Navigiere zu Plugins → Add New
- Suche nach „Tajo for WooCommerce“
- Klicke auf Install Now und dann auf Activate
- Gehe zu WooCommerce → Tajo zur Konfiguration
Manuelle Installation
Wenn du lieber manuell installieren möchtest:
# Plugin herunterladencd wp-content/pluginswget https://downloads.tajo.io/woocommerce/tajo-woocommerce-latest.zip
# Entpacken und installierenunzip tajo-woocommerce-latest.zipAnschließend im WordPress-Admin aktivieren:
- Gehe zu Plugins → Installed Plugins
- Suche „Tajo for WooCommerce“
- Klicke auf Activate
Konfiguration
Navigiere zu WooCommerce → Tajo → Settings und gib deine Zugangsdaten ein:
// Diese Einstellungen werden über das Admin-Panel konfiguriert// oder können für fortgeschrittene Setups in wp-config.php hinterlegt werden
define('TAJO_API_KEY', 'your_tajo_api_key');define('TAJO_API_SECRET', 'your_tajo_api_secret');define('BREVO_API_KEY', 'your_brevo_api_key'); // OptionalSchritt 2: Datensynchronisation konfigurieren
Einstellungen für die Kundensynchronisation
Lege im Tajo-Dashboard fest, welche Kundendaten synchronisiert werden:
{ "sync_settings": { "customers": { "enabled": true, "sync_frequency": "real-time", "fields": [ "email", "first_name", "last_name", "billing_phone", "accepts_marketing", "total_spent", "order_count", "date_created", "billing_address", "shipping_address" ] }, "orders": { "enabled": true, "sync_frequency": "real-time", "include_line_items": true, "include_shipping": true }, "products": { "enabled": true, "sync_frequency": "hourly", "include_variations": true, "include_images": true } }}WooCommerce-Hooks
Tajo hängt sich automatisch in folgende WooCommerce-Aktionen ein:
| Hook | Zweck |
|---|---|
woocommerce_created_customer | Neue Kunden zu Tajo & Brevo synchronisieren |
woocommerce_update_customer | Kundenprofile aktuell halten |
woocommerce_new_order | Käufe erfassen, Loyalty-Punkte vergeben |
woocommerce_order_status_completed | Post-Purchase-Kampagnen auslösen |
woocommerce_order_status_processing | Bestellbestätigung versenden |
woocommerce_cart_updated | Warenkorb für Abandonment verfolgen |
woocommerce_update_product | Produktkatalog synchron halten |
Initialer Datenimport
Importiere für bestehende Shops historische Daten:
<?php// Bestehende Kunden in Tajo importierenfunction tajo_import_existing_customers() { $customers = get_users([ 'role' => 'customer', 'number' => -1 ]);
foreach ($customers as $customer) { $customer_data = new WC_Customer($customer->ID);
tajo_sync_customer([ 'email' => $customer_data->get_email(), 'firstName' => $customer_data->get_first_name(), 'lastName' => $customer_data->get_last_name(), 'phone' => $customer_data->get_billing_phone(), 'totalSpent' => $customer_data->get_total_spent(), 'ordersCount' => $customer_data->get_order_count(), 'source' => 'woocommerce', 'externalId' => $customer->ID ]); }}
// Import ausführentajo_import_existing_customers();Schritt 3: Loyalty-Programm einrichten
Punktesystem konfigurieren
Lege unter WooCommerce → Tajo → Loyalty fest, wie Kunden Punkte sammeln:
<?php// Punktekonfiguration$points_config = [ // Punkte pro ausgegebenem Dollar 'purchase_points' => [ 'enabled' => true, 'rate' => 1, // 1 Punkt je 1 $ 'rounding_mode' => 'floor' ],
// Bonus-Aktionen 'bonus_points' => [ 'account_creation' => 100, 'first_purchase' => 200, 'review_submitted' => 50, 'referral_made' => 500, 'birthday_bonus' => 100, 'newsletter_signup' => 25 ],
// Multiplikatoren je Tier 'tier_multipliers' => [ 'Bronze' => 1.0, 'Silver' => 1.25, 'Gold' => 1.5, 'Platinum' => 2.0 ]];Loyalty-Widget-Shortcodes
Zeige Loyalty-Informationen auf deiner Site an:
// Punktestand des Kunden[tajo_points_balance]
// Punktehistorie[tajo_points_history limit="10"]
// Aktueller Tier-Status[tajo_loyalty_tier]
// Verfügbare Prämien[tajo_rewards_catalog]
// Empfehlungs-Link[tajo_referral_link]Loyalty-Tiers definieren
<?php$loyalty_tiers = [ [ 'name' => 'Bronze', 'min_points' => 0, 'benefits' => [ '1 point per $1 spent', 'Birthday bonus points', 'Member-only promotions' ] ], [ 'name' => 'Silver', 'min_points' => 1000, 'benefits' => [ '1.25x points multiplier', 'Free shipping on orders $50+', 'Early access to sales' ] ], [ 'name' => 'Gold', 'min_points' => 5000, 'benefits' => [ '1.5x points multiplier', 'Free shipping on all orders', 'Exclusive product access', 'Priority customer support' ] ], [ 'name' => 'Platinum', 'min_points' => 15000, 'benefits' => [ '2x points multiplier', 'Free express shipping', 'VIP experiences', 'Personal shopping assistant', 'Annual gift' ] ]];Prämienkatalog erstellen
<?php$rewards = [ [ 'id' => 'discount_5', 'name' => '$5 Off', 'points_cost' => 500, 'type' => 'fixed_cart', 'value' => 5, 'min_purchase' => 25 ], [ 'id' => 'discount_10', 'name' => '$10 Off', 'points_cost' => 900, 'type' => 'fixed_cart', 'value' => 10, 'min_purchase' => 50 ], [ 'id' => 'percent_10', 'name' => '10% Off', 'points_cost' => 750, 'type' => 'percent', 'value' => 10, 'max_discount' => 50 ], [ 'id' => 'free_shipping', 'name' => 'Free Shipping', 'points_cost' => 300, 'type' => 'free_shipping' ]];Schritt 4: Warenkorbabbruch-Wiedergewinnung
Warenkorb-Tracking konfigurieren
<?php// Warenkorb-Aktualisierungen verfolgenadd_action('woocommerce_cart_updated', 'tajo_track_cart');
function tajo_track_cart() { if (!is_user_logged_in() && !WC()->session->get('tajo_guest_email')) { return; // Ohne E-Mail kein Tracking möglich }
$cart = WC()->cart; if ($cart->is_empty()) { return; }
$customer_email = is_user_logged_in() ? wp_get_current_user()->user_email : WC()->session->get('tajo_guest_email');
$cart_items = []; foreach ($cart->get_cart() as $item) { $product = $item['data']; $cart_items[] = [ 'productId' => $item['product_id'], 'variantId' => $item['variation_id'] ?: null, 'title' => $product->get_name(), 'quantity' => $item['quantity'], 'price' => $product->get_price(), 'image' => wp_get_attachment_url($product->get_image_id()) ]; }
tajo_api_call('carts/track', [ 'email' => $customer_email, 'cartToken' => WC()->session->get_customer_id(), 'items' => $cart_items, 'totalPrice' => $cart->get_total('edit'), 'currency' => get_woocommerce_currency(), 'checkoutUrl' => wc_get_checkout_url() ]);}Gast-E-Mail erfassen
<?php// E-Mail beim Checkout für Gast-Wiedergewinnung erfassenadd_action('woocommerce_after_checkout_billing_form', 'tajo_capture_guest_email_js');
function tajo_capture_guest_email_js() { ?> <script> jQuery(function($) { $('#billing_email').on('blur', function() { var email = $(this).val(); if (email && email.includes('@')) { $.post('<?php echo admin_url('admin-ajax.php'); ?>', { action: 'tajo_capture_email', email: email, nonce: '<?php echo wp_create_nonce('tajo_email_capture'); ?>' }); } }); }); </script> <?php}
add_action('wp_ajax_nopriv_tajo_capture_email', 'tajo_capture_email_handler');function tajo_capture_email_handler() { check_ajax_referer('tajo_email_capture', 'nonce'); WC()->session->set('tajo_guest_email', sanitize_email($_POST['email'])); wp_die();}Wiedergewinnungs-Sequenz einrichten
{ "abandoned_cart_sequence": { "trigger": { "event": "cart_abandoned", "delay": "1 hour" }, "messages": [ { "delay": "1 hour", "channel": "email", "template": "cart_reminder_1", "subject": "You left something behind!" }, { "delay": "24 hours", "channel": "email", "template": "cart_reminder_2", "subject": "Your cart is waiting - 10% off inside" }, { "delay": "72 hours", "channel": "sms", "template": "cart_sms_final", "message": "Last chance! Your cart expires soon. Complete your order: {{checkout_url}}" } ], "exit_conditions": [ "order_completed", "cart_emptied", "unsubscribed" ] }}Schritt 5: Marketing-Automatisierung mit Brevo
Kundensegmente
Erstelle Segmente auf Basis von WooCommerce-Daten:
<?php$woo_segments = [ // Kaufverhalten [ 'name' => 'First-Time Buyers', 'conditions' => ['order_count' => 1] ], [ 'name' => 'Repeat Customers', 'conditions' => ['order_count' => ['$gte' => 2]] ], [ 'name' => 'VIP Customers', 'conditions' => ['total_spent' => ['$gte' => 500]] ], [ 'name' => 'At-Risk Customers', 'conditions' => [ 'last_order_date' => ['$lt' => '-90 days'], 'order_count' => ['$gte' => 2] ] ],
// Produktinteresse [ 'name' => 'Category: Electronics', 'conditions' => ['purchased_categories' => ['$contains' => 'Electronics']] ],
// Engagement [ 'name' => 'Abandoned Cart', 'conditions' => ['has_abandoned_cart' => true] ]];Trigger für automatisierte Kampagnen
<?php// Bestellung abgeschlossen – Punkte vergeben und Kampagnen auslösenadd_action('woocommerce_order_status_completed', 'tajo_order_completed', 10, 1);
function tajo_order_completed($order_id) { $order = wc_get_order($order_id); $customer_email = $order->get_billing_email();
// Kunden in Tajo abrufen oder anlegen $customer = tajo_get_customer($customer_email);
// Punkte berechnen und vergeben $points_earned = tajo_calculate_points($order, $customer); tajo_award_points($customer['id'], $points_earned, [ 'reason' => 'purchase', 'orderId' => $order_id ]);
// An Brevo für Kampagnen senden brevo_track_event($customer_email, 'order_completed', [ 'order_id' => $order_id, 'order_total' => $order->get_total(), 'points_earned' => $points_earned, 'loyalty_tier' => $customer['loyaltyTier'], 'products' => array_map(function($item) { return $item->get_name(); }, $order->get_items()) ]);}
// Bewertungsanfrage nach dem Kauf$review_request_campaign = [ 'trigger' => 'order_completed', 'delay' => '14 days', // Zeit für die Lieferung lassen 'template' => 'review_request', 'conditions' => [ 'customer_opted_in' => true ]];
// Win-back-Kampagne$win_back_campaign = [ 'trigger' => 'customer_inactive', 'conditions' => [ 'last_order_date' => '-90 days', 'order_count' => ['$gte' => 1] ], 'sequence' => [ ['delay' => '0', 'template' => 'we_miss_you', 'offer' => '15% off'], ['delay' => '7 days', 'template' => 'win_back_2', 'offer' => '20% off'], ['delay' => '14 days', 'template' => 'final_offer', 'offer' => '25% off'] ]];Schritt 6: Produktempfehlungen
Empfehlungs-Engine konfigurieren
<?php$recommendation_config = [ '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 anzeigen
// Shortcode für Produktempfehlungen[tajo_recommendations limit="4" algorithm="frequently_bought_together"]
// Oder im Template verwenden<?php$recommendations = tajo_get_recommendations([ 'customer_id' => get_current_user_id(), 'limit' => 4, 'context' => 'product_page', 'current_product' => get_the_ID()]);
foreach ($recommendations as $product_id) { $product = wc_get_product($product_id); // Produkt anzeigen}?>Schritt 7: Analytics & Reporting
Wichtige Kennzahlen-Dashboards
Greife unter WooCommerce → Tajo → Analytics oder per API auf Auswertungen zu:
<?php$dashboard_metrics = [ // Kundenkennzahlen 'customers' => [ 'total' => tajo_analytics_count('customers'), 'new_this_month' => tajo_analytics_count('customers', [ 'created_at' => ['$gte' => 'this_month'] ]), 'returning_rate' => tajo_analytics_returning_customer_rate() ],
// Umsatzkennzahlen 'revenue' => [ 'total' => tajo_analytics_sum('orders.total'), 'average_order_value' => tajo_analytics_avg('orders.total'), 'revenue_per_customer' => tajo_analytics_revenue_per_customer() ],
// Loyalty-Kennzahlen 'loyalty' => [ 'active_members' => tajo_analytics_count('loyalty_members', [ 'status' => 'active' ]), 'points_issued' => tajo_analytics_sum('points.awarded'), 'points_redeemed' => tajo_analytics_sum('points.redeemed'), 'redemption_rate' => tajo_analytics_points_redemption_rate() ],
// Kampagnen-Kennzahlen 'campaigns' => [ 'emails_sent' => brevo_analytics_emails_sent('this_month'), 'open_rate' => brevo_analytics_open_rate('this_month'), 'click_rate' => brevo_analytics_click_rate('this_month'), 'revenue_attributed' => tajo_analytics_campaign_revenue('this_month') ]];Fehlersuche
Häufige Probleme
Plugin-Konflikte
<?php// Auf Konflikt-Plugins prüfenfunction tajo_check_conflicts() { $conflicts = [];
$problematic_plugins = [ 'some-caching-plugin/plugin.php', 'aggressive-minifier/plugin.php' ];
foreach ($problematic_plugins as $plugin) { if (is_plugin_active($plugin)) { $conflicts[] = $plugin; } }
return $conflicts;}Webhook-Verifizierung
<?php// Webhook-Signatur von Tajo prüfenfunction tajo_verify_webhook($payload, $signature) { $expected = hash_hmac( 'sha256', $payload, get_option('tajo_webhook_secret') );
return hash_equals($expected, $signature);}Sync-Probleme
<?php// Sync-Probleme debuggenfunction tajo_debug_sync($customer_id) { $customer = new WC_Customer($customer_id);
error_log('Tajo Sync Debug for Customer ' . $customer_id); error_log('Email: ' . $customer->get_email()); error_log('Total Spent: ' . $customer->get_total_spent()); error_log('Order Count: ' . $customer->get_order_count());
// API-Verbindung testen $response = tajo_api_call('ping'); error_log('API Response: ' . print_r($response, true));}Rate-Limiting
<?php// Rate-Limiting für API-Aufrufe umsetzenfunction tajo_rate_limited_call($endpoint, $data, $retries = 3) { for ($i = 0; $i < $retries; $i++) { $response = tajo_api_call($endpoint, $data);
if (!is_wp_error($response)) { return $response; }
if ($response->get_error_code() === 'rate_limited') { $delay = pow(2, $i) * 1000000; // Exponential backoff in microseconds usleep($delay); continue; }
break; }
return $response;}Nächste Schritte
- Brevo-Integration konfigurieren für E-Mail-/SMS-Kampagnen
- Webhooks einrichten für Echtzeit-Events
- Kundensegmente erstellen für gezieltes Marketing
- E-Mail-Templates bauen für automatisierte Kampagnen
Support
- Integrations-Support: [email protected]
- WooCommerce-Dokumentation: woocommerce.com/documentation
- API-Referenz: docs.tajo.io/api
- Community-Forum: community.tajo.io