Google has released a new way to push the performance of your Shopping and Performance Max campaigns (with Shopping feed). Google calls it Automated Discounts. It allows for pricing products effectively in Shopping ads and in the Shopping tab. The goal is to drive more conversions.
We have created a WooCommerce plugin that makes the technical setup on a WooCommerce shop a piece of cake.
We simply call the plugin Google Automated Discounts for WooCommerce.
Business Requirements
↑ Back to topBefore starting to use the Google Automated Discounts plugin, you must make sure to meet the following business and technical requirements:
- At least 1’000 Google Shopping clicks per week.
- Conversion reporting must contain cart data. You can achieve this by using the Pixel Manager for WooCommerce. Here’s how to set it up: Guide to set up Conversion Cart Data.
- The Google Merchant Center feed needs to contain the
cost_of_goods_sold
field for each product. - The Google Merchant Center feed needs to contain the
auto_pricing_min_price
field for each product that you want to activate for Automated Discounts (products missing that field will be ignored by Automated Discounts). This plugin provides a feature with which you can set manually or calculate Auto Pricing Min Prices on each product. Those prices then can be ingested by a feed plugin and uploaded to the Google Merchant Center.
Only buy the Google Automated Discounts for WooCommerce plugin as soon as you meet all of above requirements.
For businesses that have yet to meet the necessary requirements, the transition can be a complicated and time-consuming endeavor, often necessitating significant strategic decisions.
At SweetCode, our team of seasoned professionals specializes in guiding businesses through this comprehensive process. If you are interested in engaging our services to help you not only achieve these requirements but also excel beyond them, please contact us through our support form.
Technical Requirements
↑ Back to topOur plugin, the Google Automated Discounts Plugin for WooCommerce, meets all of Google’s requirements for processing Automated Discounts.
- Product ID validation.
- Currency validation.
- Merchant center ID validation.
- Expiry validation.
- Cryptographic token signature validation.
- Keeps the discounted price for a specific product visible during the entire visitor session on every page of the shop.
- If a visitor adds a discounted product to the cart, the plugin keeps the discounted price during the regular WooCommerce 48 hours cart session.
Configuration
↑ Back to topCache Exclusion
↑ Back to topTHIS IS IMPORTANT
You need to make sure that all cache layers exclude caching if the following parameters are set. Otherwise, Automated Discounts will not be displayed and processed correctly.
Make sure to exclude caching if the URL query parameter pv2
is present in the URL.
Example: https://example.com/socks/?pv2=1234
Typically, caches exist in one or more of the following:
- Server of your hosting provider
- Caching plugins (sometimes shop managers use more than one caching plugin. Make sure to configure all of them.)
- Content Delivery Networks (CDNs) like Cloudflare.
Once you’ve set the cache exclusion, also make sure to flush the cache(s) before testing.
Google Merchant Center ID
↑ Back to top- Get the Google Merchant Center ID by logging into the Google Merchant Center and copying the ID from the URL.

- Save the Google Merchant Center ID in the settings of the plugin.

Testing
↑ Back to topGoogle will guide you through the setup step-by-step. At one point, it will generate links with which you can test and see if automated discounts work on your website.

Scenarios
↑ Back to topFirst, we show a simple and a variable product how they look like with regular prices.
Then we go through each possible scenario that can occur with price discounts.
Simple product with no discount
↑ Back to top
Variable product with no discount
↑ Back to top
Simple product with a discount applied
↑ Back to top
Variable product with a discount applied
↑ Back to top
Shop page with discounts applied
↑ Back to top

Mini cart with discount applied
↑ Back to top
Cart page with discount applied
↑ Back to top
Checkout page with discount applied
↑ Back to top

Remarks
↑ Back to topCurrency Switchers
↑ Back to topWe tested the plugin with the WPML currency switcher and it works as expected.
The plugin is compatible with every currency switcher that uses the woocommerce_currencies
filter to set the active currency. Simply try it out with your currency switcher and let us know if it works or if you need help with getting it to work.
Caching
↑ Back to topThe plugin will disable caching once a link click with an Automated Discount payload reaches the website. So this should work out of the box. If not, there might still be a caching layer that needs exclusions to be set.
Please follow the troubleshooting guide for cache issues.
Troubleshooting
↑ Back to topViewing the Error Logs
↑ Back to topThe plugin outputs errors into the regular WooCommerce log directory. It is accessible by clicking on the View Logs link in the plugin’s settings window and choosing the most recent log with the slug sgadwc. It will show all errors that it encountered. If you don’t find a log with the slug sgadwc it means that no errors have been encountered.
The website still shows cached prices, even if a valid discount has been successfully received
↑ Back to topIt is likely your caching rules are too aggressive.
Make sure to exclude caching if the URL query parameter pv2
is present in the URL.
Example: https://example.com/socks/?pv2=1234
You also must ensure that caching is disabled as soon as a WooCommerce session is active. (Typically a WooCommerce session is created when a visitor adds a product to the cart.)
Make sure that the cache is disabled if at least one of the following server-side WooCommerce cookies has been set:
woocommerce_cart_hash
woocommerce_items_in_cart
wp_woocommerce_session_
(This cookie always attaches a session ID at the end. Make sure that the match is not set toexact
but will match any cookie which contains that cookie string.)
Google Automated Discounts implementation recipes
↑ Back to topThe subsequent documentation outlines proven strategies to fulfill all business requirements. We have included only those methods that we have verified to be effective. If you have discovered alternative or superior approaches to address these business requirements, we encourage you to share your insights by submitting feeback through our support form.
Essential steps
↑ Back to top- Set up conversion cart data reporting.
- Save the
cost_of_goods_sold
andauto_pricing_min_price
in a field for each product. - Upload the Google Merchant Center feed containing
cost_of_goods_sold
andauto_pricing_min_price
. - Run Google Ads Shopping campaigns with at least 1’000 clicks per week.
- Apply for the Google Automated Discounts program at Google: Application Link
- Purchase and install the Google Automated Discounts for WooCommerce plugin.
- Double check that caching is disabled when a visitor clicks on an Automated Discount link.
- Start running and optimizing the Google Automated Discounts program.
SweetCode Implementation Service
↑ Back to topEnhance your business effortlessly with SweetCode’s custom implementation services for Automated Discounts. While some steps are relatively simple, others — such as determining and setting the Cost of Goods Sold and Auto Pricing Min Price for each product — demand meticulous preparation. Businesses vary in their compatibility with the Automated Discounts program, and each one calls for a tailored approach to ensure accurate calculations.
To truly unlock the potential of Automated Discounts, a well-crafted and customized strategy is essential for seamless implementation, execution, and performance optimization.
Should you find any of these steps challenging, SweetCode is here to help. Our team of skilled developers and business economists will guide you throughout the setup process, actively implementing the necessary steps and fine-tuning the program for optimal results. To receive a personalized quote, simply contact us via our support form, and we’ll be eager to help you elevate your business’s efficiency and profitability.
Conversion Cart Data reporting
↑ Back to topThe Pixel Manager for WooCommerce is the sole verified plugin that seamlessly transfers conversion cart data out-of-the-box. You can obtain it from sweetcode.com and woocommerce.com.
Upon activation, simply enable Google Ads conversion tracking and input the Google Merchant Center ID. With these steps completed, conversion cart data will be automatically transmitted to Google.
INFO
If conversion cart data has never been sent before, the Automated Discounts program will take at least several days before recognizing that the data is being received.
Setting cost_of_goods_sold
For setting the cost_of_goods_sold
we recommend the following plugin.
- WooCommerce Cost of Goods. The plugin doesn’t only set the Cost of Goods Sold (COGS). It also provides valuable reports on profit margins over all products sold.
Uploading the feed
↑ Back to topCurrently, the only feed plugin known to be able to output the auto_pricing_min_price
field is the WooCommerce Product Feed Manager from WPMarketingRobot. There might be other feed plugins, but we have no confirmation for any other yet.
Here’s how to set the cost_of_goods_sold
in the WooCommerce Product Feed Manager. (This example shows the use of the _wc_cog_cost
field created by the WooCommerce Cost of Goods plugin.)

Here’s how to set the auto_pricing_min_price
in the WooCommerce Product Feed Manager.

Auto Pricing Min Price
↑ Back to topINFO
Available since version 1.0.11
The plugin offers a way to set the Auto Pricing Min Price on each product. The field can then be ingested by a feed plugin and output into the Google Merchant Center feed.
The main settings are:
- A settings field for saving an Auto Pricing Min Price manually on each product.
- For automatic calculation and batch processing, the plugin offers a filter that can be used to calculate an Auto Pricing Min Price.
- The automatic calculation happens each time a product is updated manually. But, if a shop manager chooses to upload product updates with an import plugin, the automatic calculation may not be triggered. In that case, the batch regeneration on all products of the Auto Pricing Min Price can be triggered manually or by activating a nightly, recurring batch process.
Manual Setting
↑ Back to topOnce enabled, you will see a new field in the pricing section of each product where you can set your Auto Pricing Min Price.
The manually set prices are saved in a meta field with the key _google_auto_min_price_man
. This is the field you can use in your feed plugin to retrieve the manually set prices.
Automatic Calculation
↑ Back to topWhen you have dozens, hundreds, or thousands of products, automatically calculating the Auto Pricing Min Price may be more convenient.
For this case, the plugin offers a filter that can be used to calculate the Auto Pricing Min Price with any type of rule that you can imagine.
The automatic calculation is always triggered on a specific product when you manually update the product through the backend. However, if you upload product updates, such as prices, through some sort of import, the automatic calculation is not triggered. In that case, have a look at the scheduled and manual batch update features.
The automatically set prices are saved in a meta field with the key _google_auto_min_price_calc
. This is the field you can use in your feed plugin to retrieve the automatically set prices. If a manually set field is present for a particular product, it will override the calculation and be saved in the same _google_auto_min_price_calc
meta field. So you can use this field to retrieve all prices for your feed, the calculated prices and manual overrides.
Following, we provide several examples for the Auto Pricing Min Price calculation filter:
Example: How the filter works
/wp-content/themes/child-theme/functions.php
/**
* This example subtracts 1 from the regular price and returns that new value.d
*
* The filter provides a default value, which is null, and the product object.
*
* As output you'll need return a new value, or null.
**/
add_filter( 'sgadwc_google_auto_pricing_min_price_calculation', function ( $value, $product ) {
$regular_price = $product->get_regular_price();
return wc_format_decimal( $regular_price - 1, 2 );
}, 10, 2 );
Example: Return a value that is lowered by a specific percentage of the profit margin
/wp-content/themes/child-theme/functions.php
/**
* This example takes the regular price and the COGS price that was saved by a different plugin in the
* meta key _alg_wc_cog_cost.
*
* If no value is available in the meta key, null is returned.
*
* It then calculates an Auto Pricing Min Price that reduces the regular price by 20% of the profit margin.
**/
add_filter( 'sgadwc_google_auto_pricing_min_price_calculation', function ( $value, $product ) {
$regular_price = $product->get_regular_price();
$cogs = $product->get_meta( '_alg_wc_cog_cost' );
// Safeguard in case no COGS is set for this product
if (empty( $cogs )) {
return null;
}
$margin = $regular_price - $cogs;
return wc_format_decimal( $regular_price - ( $margin * 0.2 ), 2 );
}, 10, 2 );
Example: Reduce the regular price to a fixed percent
/wp-content/themes/child-theme/functions.php
/**
* This example takes the regular price and lowers it to a fixed percentage.
**/
add_filter( 'sgadwc_google_auto_pricing_min_price_calculation', function ( $value, $product ) {
$regular_price = $product->get_regular_price();
return wc_format_decimal( $regular_price * 0.8, 2 );
}, 10, 2 );
Example: Add a fixed amount to the COGS
/wp-content/themes/child-theme/functions.php
/**
* This example takes COGS and adds a fixed amount to it.
**/
add_filter( 'sgadwc_google_auto_pricing_min_price_calculation', function ( $value, $product ) {
$cogs = $product->get_meta( '_alg_wc_cog_cost' );
// Safeguard in case no COGS is set for this product
if (empty( $cogs )) {
return null;
}
return wc_format_decimal( $cogs + 4.5, 2 );
}, 10, 2 );
Scheduled Regeneration
↑ Back to topOnce activated the plugin will run a batch update of the calculated Auto Pricing Min Price at 3:25 am (local time) every morning.
It requires the automatic calculation filter to be set.
The process is very resource efficient and reliable. It can run through thousands of products quickly while limiting memory use to 90% during execution.
Tests have shown that on an average server, it can process 10’000 products within 15 minutes.
Instant Regeneration
↑ Back to topYou can trigger the batch regeneration of all products anytime you need to. This may be convenient after you’ve done a manual import and update of product prices during the day.