How To Apply WooCommerce Discount Rules In Google Merchant Center Feed?
Does anyone know a simple way to add woocommerce discount rules to our google shopping feed?
We use the woocom product feed plugin and use the feed file/link to import products in Google Merchant Center, but the woocommerce discount rules do not change the sale price of products that we would usually use in the feed mapping.
I have tried using sale price attribute as ‘Woo Discount Rules – Price’ and this has not worked. I have also tried using this woo discount rules attribute under regular price (https://rextheme.com/docs/how-to-include-discount-rules-in-the-feed-using-discount-rules-for-woocommerce-and-pfm/)
The short answer is:
The simplest, most reliable, and cost-effective method to accurately reflect dynamic WooCommerce discount rules in your Google Merchant Center (GMC) product feed is to bypass the static feed file entirely and implement a server-side synchronization solution utilizing the WooCommerce REST API and the Google Merchant API.
You would set up a script on a platform like Google Cloud Platform (GCP) – perhaps using Cloud Functions or App Engine – that periodically fetches the discounted product data (specifically, the final price after all WooCommerce discount rules have been applied) via the WooCommerce REST API.
This script then uses the Google Merchant API to directly insert or update the price and sale_price
attributes for the relevant products in your GMC account.
This approach eliminates the reliance on product feed generation plugins and ensures the prices shown in Google Shopping ads are always current and accurate, directly solving the problem of your Woo Discount Rules attribute not correctly mapping.
The long answer is:
The core problem is the product feed plugin is likely struggling to accurately compute and export the final, dynamically discounted price from the WooCommerce Discount Rules plugin into a static attribute that Google Merchant Center can reliably process, which is a common limitation of file-based feeds for dynamic pricing.
The attribute you tried, Woo Discount Rules – Price, is a custom field and the plugin’s feed generator is failing to correctly read its final value before the file is generated, or the timing of the price calculation is incorrect.
The most robust, technical, and cost-effective solution is a direct system-to-system synchronization using APIs, specifically the WooCommerce REST API and the Google Merchant API.
This integration would be orchestrated server-side, perhaps using a simple Node.js or Python script hosted on a cost-effective serverless environment like Google Cloud Platform’s (GCP) Cloud Functions.
The process involves using the WooCommerce REST API’s Get a Product endpoint to programmatically query products, and crucially, you’d ensure your custom integration logic fetches the final rendered price which has already been calculated by the WooCommerce Discount Rules plugin, rather than relying on a static or incorrectly mapped attribute.
Once the true discounted price is retrieved, the script uses the Google Merchant API’s products.insert or products.
update methods to send a real-time price update directly to your Google Merchant Center product inventory, making sure to correctly populate the price and the optional salePrice and salePriceEffectiveDate attributes.
This method is cost-effective because serverless functions on GCP are billed only when executed, and the solution is highly scalable and reliable, ensuring that the prices in your Google Shopping ads are always consistent with the prices on your WooCommerce store, avoiding the risk of disapproved products and costly customer frustration.
Leveraging the Merchant API is a superior alternative to file feeds for any store with frequently changing prices, offering near real-time updates that solve the dynamic discount rule problem.