How to Export WooCommerce Customers to Google Sheets
How to Export WooCommerce Customers to Google Sheets (Complete Guide)
Exporting WooCommerce customers to Google Sheets can be useful for analytics, marketing, reporting, or backup purposes. There are multiple ways to achieve this, ranging from manual exports to automation using Google Apps Script or plugins.
✅ Methods to Export WooCommerce Customers to Google Sheets
🔹 1️⃣ Manual Export Using WooCommerce CSV
🔹 2️⃣ Using Google Sheets + Import CSV
🔹 3️⃣ Automating with Google Apps Script
🔹 4️⃣ Using a WooCommerce Plugin (easiest)
🔹 5️⃣ Using Zapier for Continuous Sync
🔹 6️⃣ Using WooCommerce API with Google Sheets
Each method is detailed below. Choose the best one based on your needs.
📌 1️⃣ Manual Export Using WooCommerce CSV
🔹 Best for one-time exports (no automation).
Steps:
- Go to WordPress Dashboard → WooCommerce → Customers.
- Click the Export button.
- Choose "CSV" as the export format.
- Click Generate CSV and download the file.
- Open Google Sheets.
- Click File → Import → Upload CSV.
- Select your downloaded WooCommerce CSV file.
- Click Import data.
📌 Pros: Simple and free.
📌 Cons: Not automated, requires manual work every time.
📑 2️⃣ Using Google Sheets + Import CSV (Semi-Automation)
🔹 Best if you export frequently but manually update Google Sheets.
Steps:
- Export WooCommerce customers as CSV (see above).
- Open Google Sheets.
- Click Extensions → Apps Script.
- Copy and paste this script:
javascriptfunction importCSVFromDrive() { var fileId = "YOUR_CSV_FILE_ID"; // Replace with actual File ID from Google Drive
var file = DriveApp.getFileById(fileId);
var csvData = file.getBlob().getDataAsString();
var data = Utilities.parseCsv(csvData);
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
sheet.clear();
sheet.getRange(1, 1, data.length, data[0].length).setValues(data);
}
- Replace
"YOUR_CSV_FILE_ID"
with the actual Google Drive file ID of your CSV. - Run the script to fetch updated customer data from the CSV.
📌 Pros: Reduces manual work.
📌 Cons: Still requires CSV upload before running the script.
🤖 3️⃣ Automate WooCommerce Export to Google Sheets Using Google Apps Script
🔹 Best for fully automated exports without manual CSV uploads.
Steps:
- Open Google Sheets.
- Click Extensions → Apps Script.
- Paste the following script:
javascriptfunction fetchWooCommerceCustomers() { var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var url = "https://yourwebsite.com/wp-json/wc/v3/customers";
var consumerKey = "YOUR_CONSUMER_KEY";
var consumerSecret = "YOUR_CONSUMER_SECRET";
var options = {
"method": "GET",
"headers": {
"Authorization": "Basic " + Utilities.base64Encode(consumerKey + ":" + consumerSecret)
}
};
var response = UrlFetchApp.fetch(url, options);
var customers = JSON.parse(response.getContentText());
sheet.clear();
sheet.appendRow(["ID", "Name", "Email", "Phone", "Orders", "Total Spent"]);
customers.forEach(function(customer) {
sheet.appendRow([
customer.id,
customer.first_name + " " + customer.last_name,
customer.email,
customer.billing.phone,
customer.orders_count,
customer.total_spent
]);
});
}
Replace:
"https://yourwebsite.com/wp-json/wc/v3/customers"
→ with your WooCommerce site URL."YOUR_CONSUMER_KEY"
and"YOUR_CONSUMER_SECRET"
→ Generate from WooCommerce → Settings → Advanced → REST API.
Click Run to fetch customers into Google Sheets.
Set up a Trigger (Clock Icon) → Time-Driven to run the script daily/weekly.
📌 Pros: Fully automated, no manual CSV needed.
📌 Cons: Requires API setup.
🛠 4️⃣ Using a WooCommerce Plugin (Easiest Way)
🔹 Best for non-technical users.
Popular Plugins:
Steps:
- Install & activate the chosen plugin.
- Go to WooCommerce → Integration → Google Sheets.
- Connect your Google Account.
- Choose "Customers" as the data to export.
- Set export frequency (real-time, daily, weekly).
- Click Save & Activate.
📌 Pros: No coding required, easy to use.
📌 Cons: Some plugins require paid plans.
🔗 5️⃣ Using Zapier for Continuous Sync
🔹 Best for real-time updates whenever a new customer registers.
Steps:
- Sign up at Zapier.
- Click "Create Zap".
- Choose Trigger: WooCommerce → New Customer.
- Choose Action: Google Sheets → Create Row.
- Connect Google Sheets and select the spreadsheet.
- Map WooCommerce customer fields to Google Sheets columns.
- Click Test & Publish.
📌 Pros: Works in real-time, no coding needed.
📌 Cons: Free plan has limited Zaps per month.
🌍 6️⃣ Using WooCommerce API with Google Sheets (Advanced)
🔹 Best for developers & advanced automation.
- Use Postman or cURL to test WooCommerce API requests.
- Fetch customers using REST API (
GET /wc/v3/customers
). - Send data directly to Google Sheets via Google Apps Script.
📌 Pros: Fast & flexible.
📌 Cons: Requires API knowledge.
🎯 Which Method is Best for You?
Method | Best For | Pros | Cons |
---|---|---|---|
Manual CSV Export | One-time use | Free, no setup needed | Repetitive, not automated |
Google Sheets Import CSV | Occasional updates | Saves time | Still requires manual CSV |
Google Apps Script API | Fully automated exports | No plugins, fully automatic | Requires API keys |
WooCommerce Plugin | Non-technical users | Easy, no coding needed | Some plugins are paid |
Zapier | Real-time sync | Automatic, no coding | Free plan limitations |
WooCommerce API + Code | Developers | Full control | Requires API knowledge |
🚀 Final Thoughts
- For occasional exports: Use WooCommerce CSV + Google Sheets Import.
- For automation: Use Google Apps Script or WooCommerce Plugins.
- For real-time sync: Use Zapier.
- For full control: Use the WooCommerce API with Apps Script.
0 Comments