Complex WooCommerce/Facebook catalogue synchronisation using Google Script

There are various plugins available for WooCommerce that enable synchronisation with the Facebook Catalogue. This allows you to […]

· 2 min read· Jaap van Duijn

There are various plugins available for WooCommerce that enable synchronisation with the Facebook Catalogue. This allows you to showcase your products to a wide audience via Facebook and Instagram. You can also use the product information for dynamic retargeting. These plugins work well if you’re using a single language and a single currency, but you’ll face a challenge straight away if you have a multilingual website and multiple currencies. We’ve found the solution using Google Script!

Google Spreadsheets for products, prices and translations

Facebook Catalogue offers various options for synchronising data. You can do this manually (i.e. one by one), by uploading a file (XML, CSV, Excel) or using an external file. Google Spreadsheets is also included here, and by using Google Script you can automate processes. WooCommerce allows you to use the WordPress REST API. 

Product details

In the Google Script, we retrieve all the product data and process it in the Google Spreadsheet in accordance with Facebook’s guidelines. In the product file, we store the data in the default language and currency. For the Dutch products in this Dutch example, we even had to add 21% VAT.

Update prices

Create a new Google Spreadsheet in which you retrieve the prices for each product in the various currencies. The match is made based on the product number. Also include the product’s landing page for the relevant currency so that the end user can be redirected to the correct web page. 

Update translations

Create a third Google Spreadsheet and once again retrieve the product information from the WordPress REST API. For each language, retrieve the translated product information and process it in the Google Spreadsheet in accordance with Facebook’s guidelines. 

Scheduling script runs

Schedule the functions as a task in Google Script every morning at 6.00 am. This ensures that the Google Spreadsheets are refreshed every day. Do make sure to clear the spreadsheets first, before filling them with new data. In Facebook Business, link the three Google Spreadsheet files and schedule them to synchronise every day at 7.00 am. If you need to update stock levels more quickly, for example, you can also set the tasks to run hourly. (Unfortunately) it cannot be done any faster.

What does the end user see?

The Facebook Catalogue displays all products on both Facebook and Instagram. If a user follows your Facebook page or Instagram account, your products are immediately displayed in the correct language and currency. People cannot actually make purchases on Facebook or Instagram; they are redirected to your online shop. In this case, a UK user will be redirected to the English-language product page with prices in British pounds, and a visitor from Switzerland to the German-language (or French-language) page with prices in Swiss francs. If you’ve added new products, your followers will even see these changes in their news feed.

Would you also like to promote your multilingual online shop on Facebook with the correct translations and currencies? We’d be happy to help you with this!