Back to Guides
    integrationsintermediate25 minutesDec 31, 2024

    WooCommerce Data Export to Cogny

    Export WooCommerce data to BigQuery for AI-powered analytics. Unlock insights on customer behavior, product performance, and revenue optimization.

    WooCommerce Data Export to Cogny

    TL;DR

    Export WooCommerce data to BigQuery for AI-powered analytics on customer lifetime value, product performance, and channel attribution—no manual exports required.

    What you'll accomplish:

    • Connect WooCommerce to BigQuery using ETL connector plugin
    • Automatically sync orders, customers, and products daily
    • Enable AI analysis identifying which traffic sources bring repeat customers
    • Discover product combinations predicting high lifetime value
    • Analyze cart abandonment patterns by traffic source

    Time required: 25 minutes | Difficulty: Intermediate | Prerequisites: WordPress site with WooCommerce, admin access, Google Cloud account, Cogny account

    Quick Start: Install WooCommerce BigQuery connector plugin (or use Fivetran/Stitch) → Configure authentication → Set daily sync schedule → Connect BigQuery to Cogny.


    Related Resources

    Essential guides for WooCommerce data analysis:


    Question

    How do I connect WooCommerce to Cogny for AI-powered e-commerce analytics?

    Answer

    Export WooCommerce data to BigQuery using a connector plugin or ETL tool. Connect BigQuery to Cogny. AI analyzes your orders, customers, and products to find growth opportunities.

    No manual exports. No spreadsheets. Just automatic insights.

    Quick Tip: Export historical order data first to build baseline metrics before automating ongoing syncs. Starting with 12 months of data gives AI enough signal for seasonal pattern analysis.

    Why Connect WooCommerce?

    WooCommerce gives you reports. Orders. Revenue. Top products.

    But it doesn't tell you:

    • Which traffic source brings customers who actually come back?
    • What's your true CAC when you factor in returns and refunds?
    • Which product combinations predict high lifetime value?
    • How do abandoned carts differ by traffic source?

    Cogny's AI finds these patterns automatically.

    What You'll Get

    After connecting WooCommerce:

    Customer lifetime value analysis Segment customers by LTV and find what high-value customers have in common

    Product intelligence Which products drive repeat purchases vs. one-time buys

    Channel attribution Multi-touch path analysis across all marketing channels

    Cart abandonment insights Why people leave and which abandoned carts to prioritize

    Inventory optimization What to stock more, what to discontinue, based on LTV impact


    Note: Unlike Shopify, WooCommerce requires a third-party plugin or custom export script. We recommend the BigQuery WordPress plugin for automated syncing or Fivetran for production reliability.

    Prerequisites

    You need:

    1. WordPress site with WooCommerce (any hosting)
    2. WooCommerce admin access
    3. Google Cloud account (free tier works)
    4. Cogny account (for AI analysis)

    Step 1: Choose Your Export Method

    Three options:

    Option A: Plugin-Based Export (Easiest)

    • Install WordPress plugin
    • Configure BigQuery credentials
    • Automatic sync

    Best for: Non-technical users, smaller stores (<10K orders/month)

    Option B: ETL Service (Recommended)

    • Use Fivetran or Airbyte
    • More reliable
    • Better for scale

    Best for: Growing stores, agencies, multiple sites

    Option C: Custom API Export (Advanced)

    • Use WooCommerce REST API
    • Build custom sync script
    • Most control

    Best for: Developers, custom requirements

    This guide covers Option B (Fivetran) - most reliable for production use.

    Time: 1 minute to decide


    Step 2: Set Up Google Cloud Project

    Go to console.cloud.google.com

    Click Select a projectNew Project

    Name: woocommerce-analytics

    Click Create

    Google gives you $300 in free credits.

    Time: 2 minutes


    Step 3: Enable BigQuery API

    In Google Cloud Console, search for "BigQuery API"

    Click Enable

    Wait for activation (usually 30 seconds).

    Time: 1 minute


    Step 4: Create BigQuery Dataset

    Go to console.cloud.google.com/bigquery

    Click your project name in Explorer panel.

    Click (three dots) → Create dataset

    Dataset ID: woocommerce

    Location: Choose region

    • US stores: us (multi-region)
    • EU stores: eu (multi-region)
    • Other: Select closest region

    Click Create Dataset

    Time: 2 minutes


    Step 5: Set Up Fivetran Connector

    Go to fivetran.com

    Sign up (free trial available).

    Click + Connector

    Search for "WooCommerce"

    Click WooCommerce connector.

    Time: 2 minutes


    Step 6: Configure WooCommerce Connection

    Get WooCommerce API credentials:

    In WordPress admin:

    Go to WooCommerceSettingsAdvancedREST API

    Click Add key

    Description: Fivetran BigQuery Sync

    User: Select admin user

    Permissions: Read

    Click Generate API Key

    Copy:

    • Consumer Key: ck_xxxxxxxxxxxxxxx
    • Consumer Secret: cs_xxxxxxxxxxxxxxx

    IMPORTANT: Save these now. They won't be shown again.

    Time: 3 minutes


    Enter credentials in Fivetran:

    Back in Fivetran setup:

    Shop URL: https://yourstore.com

    Consumer Key: Paste ck_...

    Consumer Secret: Paste cs_...

    Historical sync: Choose how far back to sync

    • Recommended: 12 months (for seasonal analysis)
    • Minimum: 3 months (for basic insights)

    Click Save & Test

    Fivetran tests connection.

    If successful: ✅ "Connection successful"

    If failed: Check URL, verify API keys, confirm WooCommerce version is 3.0+

    Time: 3 minutes


    Step 7: Configure BigQuery Destination

    Create service account for Fivetran:

    In Google Cloud Console:

    Go to IAM & AdminService Accounts

    Click Create Service Account

    Name: fivetran-woocommerce-sync

    Description: Fivetran connector for WooCommerce data

    Click Create and Continue

    Grant role: BigQuery Data Editor

    Click ContinueDone

    Time: 3 minutes


    Create JSON key:

    Click the service account you just created.

    Go to Keys tab.

    Click Add KeyCreate new key

    Key type: JSON

    Click Create

    JSON file downloads automatically.

    Time: 1 minute


    Configure in Fivetran:

    In Fivetran destination settings:

    Destination type: BigQuery

    Project ID: Your Google Cloud project ID (e.g., woocommerce-analytics-123456)

    Dataset location: Same region you chose in Step 4

    Service account JSON: Upload the downloaded JSON file

    Click Save & Test

    Time: 2 minutes


    Step 8: Start Initial Sync

    Click Start Initial Sync in Fivetran.

    What gets synced:

    • Orders: Every order and status
    • Order items: Line items (products in each order)
    • Customers: Customer details and history
    • Products: Full catalog with variations
    • Coupons: Discount code usage
    • Refunds: Return and refund data
    • Order notes: Customer and admin notes
    • Tax and shipping: Transaction details

    Sync duration:

    • Small store (<1,000 orders): 15-30 minutes
    • Medium store (1K-10K orders): 1-3 hours
    • Large store (10K-50K orders): 4-8 hours
    • Very large (50K+ orders): 8-24 hours

    You'll get email notification when complete.

    Time: Varies (but you can proceed while syncing)


    Step 9: Verify Data in BigQuery

    While sync runs, check BigQuery.

    Go to console.cloud.google.com/bigquery

    Expand your project → woocommerce dataset.

    Tables appear as sync progresses:

    • orders
    • order_items
    • customers
    • products
    • product_variations
    • coupons
    • refunds
    • order_notes

    Click a table → Preview tab → See your data.

    Time: 2 minutes


    Step 10: Connect BigQuery to Cogny

    Follow our BigQuery Connection Guide. Once connected, you can run AI-powered CAC analysis to optimize your acquisition spend.

    Quick steps:

    1. Create service account for Cogny
    2. Grant BigQuery Data Viewer role
    3. Download JSON key
    4. In Cogny: Add Data Source → BigQuery
    5. Upload JSON key
    6. Select woocommerce dataset

    Time: 5 minutes


    Step 11: Let AI Analyze

    Cogny's AI immediately:

    Maps your schema (5-10 minutes)

    • Identifies tables and relationships
    • Connects orders → customers → products
    • Builds data model

    Analyzes historical patterns (1-24 hours)

    • Customer behavior trends
    • Product performance
    • Channel effectiveness
    • Seasonal patterns

    Generates recommendations (ongoing)

    • Specific optimizations
    • Product insights
    • Pricing strategies
    • Inventory guidance

    What's in Your WooCommerce Data?

    Orders table:

    Every purchase.

    Key fields:

    • id - Order ID
    • status - pending, processing, completed, refunded, failed
    • currency - USD, EUR, etc.
    • total - Order total
    • total_tax - Tax amount
    • shipping_total - Shipping cost
    • discount_total - Discounts applied
    • customer_id - Who ordered
    • billing_email - Customer email
    • date_created - Order timestamp
    • date_paid - Payment timestamp
    • payment_method - Gateway used
    • transaction_id - Payment transaction ID

    Order_items table:

    Individual products in each order.

    Key fields:

    • order_id - Which order
    • product_id - Which product
    • variation_id - Product variation (size, color, etc.)
    • quantity - How many
    • subtotal - Item subtotal
    • total - Item total (after discount)
    • tax_total - Tax on item

    Customers table:

    Everyone who's ordered.

    Key fields:

    • id - Customer ID
    • email - Email address
    • first_name, last_name - Name
    • username - WP username
    • date_created - First order date
    • orders_count - Total orders
    • total_spent - Lifetime value
    • avatar_url - Profile image

    Products table:

    Your catalog.

    Key fields:

    • id - Product ID
    • name - Product name
    • slug - URL slug
    • type - simple, variable, grouped, etc.
    • status - publish, draft, private
    • price - Current price
    • regular_price - Non-sale price
    • sale_price - Sale price
    • categories - Product categories
    • tags - Product tags
    • stock_status - instock, outofstock, onbackorder

    Example AI Insights

    1. High-LTV Customer Acquisition Sources

    AI finds: "Customers from organic search:

    • Average first order: $67
    • 6-month LTV: $312
    • Repeat purchase rate: 47%

    Customers from Facebook ads:

    • Average first order: $89
    • 6-month LTV: $148
    • Repeat purchase rate: 18%

    Organic customers are 2.1x more valuable long-term."

    Recommendation: "Invest more in SEO and content. Reduce Facebook prospecting budget. Focus Facebook on retargeting."


    2. Product Bundle Opportunities

    AI finds: "Product A and Product B are purchased together in separate orders by 340 customers within 30 days. Average gap between purchases: 18 days. Combined: $127 revenue per customer.

    If bundled with 10% discount:

    • Estimated take rate: 65%
    • Revenue per bundle: $114
    • But single transaction = better experience, lower support, higher satisfaction."

    Recommendation: "Create 'A + B Complete Kit' bundle. Expected: 220 bundles/month, +$25K revenue."


    3. Abandoned Cart Analysis by Source

    AI finds: "Cart abandonment rate by source:

    Google Ads: 72% abandonment

    • High cart value ($142 avg)
    • Abandon at shipping cost step
    • Issue: Unexpected shipping fees

    Organic: 64% abandonment

    • Medium cart value ($87 avg)
    • Abandon at account creation
    • Issue: Forced registration

    Email campaigns: 48% abandonment

    • Warm traffic, high intent
    • Abandon at payment step
    • Issue: Limited payment options"

    Recommendation:

    1. Show shipping costs earlier for paid traffic
    2. Enable guest checkout
    3. Add more payment methods (Apple Pay, PayPal)

    Expected impact: 8-12% increase in conversions


    4. Discount Strategy Impact

    AI finds: "Customers who use 25%+ discount on first order:

    • Higher initial AOV ($98 vs $72)
    • BUT: 63% lower repeat rate
    • 12-month LTV: $118

    Customers with no discount:

    • Lower first order ($72)
    • 52% make second purchase within 90 days
    • 12-month LTV: $267

    Discounts attract bargain hunters, not loyal customers."

    Recommendation: "Replace first-order discounts with loyalty program. Offer 10% on second purchase instead. Expected LTV increase: 35%."


    Combining WooCommerce with Marketing Data

    Connect these for full picture:

    1. WooCommerce (orders, LTV)
    2. Google Ads (acquisition cost, ad performance)
    3. Meta Ads (social creative effectiveness)
    4. GA4 (website behavior, funnel analysis)

    What this enables:

    True ROI by channel:

    "Google Shopping:

    • Ad spend: $12,400/month
    • Orders: 187
    • Revenue: $23,800
    • But: Returns + refunds: $3,200
    • True profit: $8,200
    • ROI: 66%

    Facebook Prospecting:

    • Ad spend: $8,900/month
    • Orders: 142
    • Revenue: $18,400
    • Returns + refunds: $5,100
    • True profit: $4,400
    • ROI: 49%"

    Recommendation: "Shift budget from Facebook to Google Shopping."


    Multi-touch attribution:

    "Customer journey for high-LTV customers:

    1. See Facebook ad (awareness)
    2. Google search → organic result (research)
    3. Leave, return via email (nurture)
    4. Google search → ad click (intent)
    5. Purchase

    Average touchpoints before purchase: 4.7 Time from first touch to purchase: 12 days"

    Insight: All channels contribute. Stop over-crediting last click.


    Common Issues

    "API connection failed"

    Check:

    1. WooCommerce REST API enabled?
    2. API keys copied correctly (no extra spaces)?
    3. WordPress site accessible publicly (not localhost or staging with IP restrictions)?
    4. SSL certificate valid (https://)?

    "Some orders missing"

    Check order status filter in Fivetran:

    • By default syncs: completed, processing, on-hold
    • Doesn't sync: draft, pending, failed

    Adjust filter if you need pending orders.

    "Customer data looks incomplete"

    WooCommerce guest checkout creates orders without full customer records. This is normal. Cogny can still analyze by email address.

    "Product variations not showing up"

    Check:

    1. Products are "Variable" type in WooCommerce
    2. Variations are published (not draft)
    3. Fivetran sync includes product_variations table

    "Data sync stopped"

    Check Fivetran connector status:

    • Quota limits (free tier: 500K rows/month)
    • API rate limits (WooCommerce default: 50 requests/minute)
    • WordPress site downtime

    Fivetran shows detailed error logs.


    Pro Tips

    1. Use UTM parameters in marketing campaigns

    WooCommerce doesn't track UTM parameters by default.

    Add this to your theme's functions.php:

    // Save UTM parameters to order meta
    add_action('woocommerce_checkout_create_order', function($order, $data) {
        if (isset($_COOKIE['utm_source'])) {
            $order->update_meta_data('_utm_source', sanitize_text_field($_COOKIE['utm_source']));
        }
        if (isset($_COOKIE['utm_medium'])) {
            $order->update_meta_data('_utm_medium', sanitize_text_field($_COOKIE['utm_medium']));
        }
        if (isset($_COOKIE['utm_campaign'])) {
            $order->update_meta_data('_utm_campaign', sanitize_text_field($_COOKIE['utm_campaign']));
        }
    }, 10, 2);
    

    Then save UTM to cookies on landing:

    // Save UTM to cookies
    (function() {
        const params = new URLSearchParams(window.location.search);
        ['utm_source', 'utm_medium', 'utm_campaign', 'utm_content', 'utm_term'].forEach(param => {
            if (params.has(param)) {
                document.cookie = param + '=' + params.get(param) + '; path=/; max-age=2592000'; // 30 days
            }
        });
    })();
    

    Now AI can attribute orders to specific campaigns.

    2. Track abandoned carts

    Install plugin like "WooCommerce Cart Abandonment Recovery"

    Captures abandoned cart data. Syncs to BigQuery via Fivetran. AI analyzes why carts are abandoned.

    3. Use customer tags

    Tag customers in WooCommerce:

    • "VIP"
    • "Wholesale"
    • "Influencer"

    These tags sync to BigQuery. AI segments analysis by tag.

    4. Enable detailed logging

    WooCommerce → Settings → Advanced → Logging

    Set log level to "Info" or "Debug"

    Helps troubleshoot sync issues.

    5. Sync product categories and tags

    Make sure Fivetran includes these tables:

    • product_categories
    • product_tags

    AI uses these for product performance analysis.

    6. Track refund reasons

    Use plugin to capture refund reasons. Or add custom order notes.

    AI identifies patterns:

    • "Wrong size" → Size guide problem
    • "Quality issue" → Product quality
    • "Late delivery" → Shipping optimization

    What You Can Do Now

    Immediate actions:

    1. Identify best customers

      • Segment by LTV
      • Find common characteristics
      • Target lookalike audiences
    2. Optimize product catalog

      • Best sellers by cohort
      • Products that drive repeat purchases
      • Dead inventory to clear
    3. Fix conversion leaks

      • See where carts are abandoned
      • Get specific fix recommendations
      • Measure impact
    4. Improve retention

      • Identify churn signals
      • Find what drives repeat purchases
      • Build automated re-engagement

    Alternative: WooCommerce Plugin Method

    If you prefer a plugin instead of Fivetran:

    Option: WooCommerce Google BigQuery Plugin

    Some plugins available on WordPress.org or GitHub:

    • "WooCommerce BigQuery Export"
    • Custom plugins by hosting providers

    Pros:

    • No third-party service (Fivetran)
    • Potentially free

    Cons:

    • Less reliable
    • Harder to troubleshoot
    • May not sync all tables
    • Performance impact on your site

    Recommendation: Use Fivetran for production. Plugins for testing/POC only.


    Next Steps

    Immediate actions:

    • Export at least 3 months of historical data for baseline analysis
    • Segment customers by LTV to find high-value acquisition sources

    Advanced implementation:

    Need help? Contact support


    FAQ

    Q: Will this slow down my WooCommerce site?

    Minimal impact.

    Fivetran uses WooCommerce REST API. Queries are rate-limited and throttled.

    For extra safety:

    • Sync during off-peak hours
    • Use caching plugin (WP Rocket, W3 Total Cache)

    Q: What about GDPR compliance?

    You're the data controller. Data stays in YOUR BigQuery.

    For GDPR:

    • Update privacy policy to mention analytics
    • Provide data deletion on request
    • Consider anonymizing customer data in BigQuery

    Q: Can I connect multiple WooCommerce sites?

    Yes.

    Each site becomes a separate dataset. Cogny analyzes together or separately.

    Great for:

    • Multi-brand stores
    • International sites
    • Separate B2B and B2C

    Q: What's the cost?

    Fivetran:

    • Free tier: 500K rows/month
    • Paid: $60-120/month for most stores

    BigQuery:

    • Storage: ~$2-10/month
    • Queries: Usually free (within Google Cloud free tier)

    Total: ~$5-130/month

    Q: How often does data sync?

    Fivetran free: Daily Fivetran paid: Hourly, or real-time

    Most stores don't need real-time. Daily is fine for AI insights.

    Q: What if I'm on WooCommerce.com hosted?

    Same process works.

    WooCommerce.com = WordPress.com with WooCommerce. REST API available on Business plan and higher.

    Q: Can I use this with WooCommerce Subscriptions?

    Yes.

    Subscription data syncs through:

    • subscriptions table (subscription details)
    • orders table (renewal orders)

    AI analyzes:

    • Subscription churn patterns
    • Lifetime value with subscriptions
    • Upgrade/downgrade trends

    Q: What happens to historical data if I disconnect?

    Data already in BigQuery stays there. You keep it forever (unless you delete).

    Future syncs stop. Historical analysis still works.


    Ready to Unlock WooCommerce Insights?

    Most WooCommerce stores don't know:

    • Which 20% of customers drive 80% of profit (and where they come from)
    • Why 70% of first-time buyers never return
    • Which products predict high lifetime value
    • How much money is lost to preventable cart abandonment

    You can't find this in WooCommerce reports. Too much data. Too many dimensions.

    AI finds it automatically.

    Not set up yet?

    Schedule a demo and we'll show you what's hiding in your WooCommerce data.


    About This Guide

    Written by the Cogny team—built by the founders who created AI optimization systems for Netflix, Zalando, and Momondo at Campanja, and scaled growth for Kry, Epidemic Sound, and Yubico through GrowthHackers.se.

    We've integrated WooCommerce for hundreds of stores. This is the battle-tested process.

    Last Updated: December 31, 2024

    Ready to Get Started?

    See Cogny in Action

    Schedule a demo to see how AI can transform your marketing analytics and automate your growth optimization.

    Schedule Demo