Google Automated Discounts for WooCommerce
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".
Beta
Currently, the plugin is undergoing a closed beta testing phase. If you wish to participate, please send us a request to support@sweetcode.com
Business Requirements
Before starting to use the Google Automated Discounts plugin, you must make sure to meet the following business and technical requirements:
- 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. - 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.
Only buy the Google Automated Discounts for WooCommerce plugin as soon as you meet all of above requirements.
For shops that don't fulfil the requirements yet, the transition can be a complex and lengthy process that usually requires important business decisions to be made.
SweetCode employs experts who have the experience in consulting businesses to go through that entire process. If you are interested in hiring us to help with achieving all requirements and more, please send us an email to support@sweetcode.com
Technical Requirements
The plugin matches 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
Cache Exclusion
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
- 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
Google 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
First, 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
Variable product with no discount
Simple product with a discount applied
Variable product with a discount applied
Shop page with discounts applied
Mini cart with discount applied
Cart page with discount applied
Checkout page with discount applied
Remarks
Currency Switchers
We 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
The 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 there might still be a caching layer that needs exclusions to be set.
Please follow the troubleshooting guide for cache issues.
Troubleshooting
Viewing the Error Logs
The 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
It 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.)