DEPRECATED: As of at least Aug 30, 2022, the defautlt Google sales channel properly sends the product’s sale price to Google. This post and code are no longer being maintained, and are here only for reference.

Create a Price Feed in Shopify
The first step is to create a data feed in Shopify containing your products sale and regular prices. We can accomplish this by creating a custom Shopify Collection Template that will output XML data instead of HTML:
1. Create a new Collection Template
{% layout none %}<?xml version="1.0"?>
<rss xmlns:g="http://base.google.com/ns/1.0" version="2.0">
{% paginate collection.products by 1000 %}
{%- case shop.currency -%}
{%- when 'USD' -%}{%- assign CountryCode = 'US' -%}
{%- when 'CAD' -%}{%- assign CountryCode = 'CA' -%}
{%- when 'GBP' -%}{%- assign CountryCode = 'GB' -%}
{%- when 'AUD' -%}{%- assign CountryCode = 'AU' -%}
{%- else -%}{%- assign CountryCode = 'US' -%}
{%- endcase -%}
<channel>
<title>{{ shop.name }} {{ collection.title | strip_html | strip_newlines | replace: '&', '&' }}</title>
<link>{{ shop.url }}</link>
<description>{{ collection.description | strip_html | strip_newlines | replace: '&', '&' }}</description>
{% for product in collection.products %}
{% for variant in product.variants %}
{%- if variant.compare_at_price > variant.price -%}
{%- assign OnSale = true -%}
{%- assign Price = variant.compare_at_price -%}
{%- assign SalePrice = variant.price -%}
<item>
<g:item_group_id>shopify_{{ CountryCode }}_{{ product.id }}</g:item_group_id>
<g:id>shopify_{{ CountryCode }}_{{ product.id }}_{{ variant.id }}</g:id>
<g:price>{{ Price | money_without_currency }} {{ shop.currency }}</g:price>
<g:sale_price>{{ SalePrice | money_without_currency }} {{ shop.currency }}</g:sale_price>
</item>
{%- endif -%}
{% endfor %}
{% endfor %}
</channel>
</rss>
{% endpaginate %}
2. Create a new collection called “google-feed-sale-price” based on your Collection Template
- IMPORTANT Choose xml-pricing-feed as your collection template
- Add products to the collection (or you can create an automatic collection with Compare At Price is Greater than 1)
3. Preview the collection and copy the url.
- Your url should look something like this: yourstoredomain.com/collections/google-feed-sale-price
- When you preview your page, it should look like a bunch of unformatted text on your page. If you see images, then you probably skipped the first bullet point in Step 2.
Add a Supplemental Data Feed in Google Merchant Center
4. Open Merchant Center and go to
Products > Feeds > Supplemental Feeds > Add Supplemental Feed
- Name: Sale Pricing Update
- Feed Type: Scheduled Fetch
- File Name: google-feed-sale-price
- File Url: yourstoredomain.com/collections/google-feed-sale-price
Leave everything else as default values and click Continue
5. Make sure there’s a checkmark beside Content API and click Create Feed
6. You should now see your newly created feed in the Supplemental Feeds section. Click on your feed’s name and then click on Fetch Now to update pricing data immediately.
Done
It may take up to 30 minutes for your main feed to be updated. Any new sale pricing will now be uploaded once per day.