This tutorial explains how to sync WooCommerce orders with Google Sheets. To do this, I will use a simple Google Apps Script that integrates WooCommerce directly in Google Sheets. The script can be run at automated intervals and it fetches details of all the orders and show them to you. For each order its displays information like order id, first name, last name, billing address, mobile phone number, quantity, price, order key, and order status. You can also opt to run this script manually at your will anytime to sync the Google Sheet with the orders listed in your WooCommerce dashboard. It can also update an order’s status in the sheet when its status changes in the store’s dashboard.
There are some services to do the exact same thing automatically such as Zapier. But they are not free and has a very limited free plan. For a free and unlimited alternative to Zapier’s WooCommerce-Google Sheets integration, you can rely on the Google Apps Script that I have mentioned here. This script basically uses the rest API already provided by WooCommerce installed on your website. In order to set up this, you need a WooCommerce store hosted on a website that has HTTPS enabled, a Google account, and a little knowledge of Google Sheet. This simple script is open source as well and it is available on GitHub. If you want to improve it then you are free to do so and in later updates there may be some more features.
How to Sync WooCommerce Orders with Google Sheets?
I have already mentioned the requirements needed for the setup of the Google Apps Script. So, without wasting much time, let’s just get started. The very first thing that you have to do is generate REST API keys from your WooCommerce dashboard.
To generate API keys, you go to WooCommerce > Settings > Advanced section. In the REST API tab, add a new key.
Click “Generate API key“. Your keys will be shown there and make sure that you do not close the tab yet. You need to copy down both; the API key and the API secret.
Now, you just make a copy of this Google Sheet from here. This sheet is already configured with the Google Apps Script that will be responsible for fetching the orders from your WooCommerce Store and display them in the sheet. This sheet has some fields on the top left side that you have to fill out.
In the Google Sheet that you just copied, enter the API key and the API secret that we generated earlier. Along with this, you also have to enter the URL of your store and a date. The date parameter will be used as a starting date to fetch the orders details from the store.
Now everything has just set up and use the “SYNC ORDERS” button to run script for the very first time. In the first run, you will have to authorize the script. Click on the Continue button, and then choose your Google account from the list and then click on the Allow button. Since this script is not authorized by Google so it will give you a warning. To get around with that, you just click on the “Advanced” and then click on “Proceed anyway” option.
Finally, click on the “SYNC ORDERS” button one more time. It will now start fetching your orders and will display them in the Google Sheet. Depending on number of orders available in your store, it may take some time. The final sheet with all the orders will look like the one in the following screenshot.
How to Update Google Sheet with WooCommerce Orders Details Automatically?
At this point this script is working and you can use it anytime to sync your orders with the Google Sheet. However, you will have to run the script manually every time you want to sync the orders. But you can leave it to autopilot to automatically run the script at specified intervals. The “Triggers” feature of Script Editor can be used to achieve this. Click on Tools > Script editor. The script editor will now open up and you go to the Edit > Current projects triggers menu and create a time driven trigger.
You will have to select “start_syncv2” as the function to run and then configure the corresponding time interval based on your needs. There are options to update sheet daily, hourly, monthly, and even by minutes.
That is it. In this way, you can use this simple and powerful Google Apps script to always keep your WooCommerce orders and a Google sheet in sync with all the necessary details. This is a great alternative to the Zapier integration as you get the unlimited number of runs. The best part is that, every time when the cheat runs it fetches all the orders from the store again and again. So this is helpful as you will always get the updated list of orders and their statuses.
Final thoughts:
I am simply amazed by the functionality of this script that I have mentioned. It works perfectly and can help you always keep your WooCommerce orders synced in a Google Sheet. Once you have all your orders in the spreadsheet, you can make use of other features of Google Sheet to manipulate the data. Or, or you can also export order details in a variety of formats such as excel, PDF, CSV, TSV, and ODT. So, if you’re looking for free alternative for Zapier-WooCommerce integration then you are at the right place. Just go through the step-by-step guide above and get it done in no time.