As of Aug 12, 2020 Shopify’s Google Shopping app does NOT send compare_at_price to Google Merchant Center. This means that you are unlikely to receive the SALE annotation in your Google Shopping ads when your products are on sale:

To fix this, you must create and upload a supplemental data feed to Google Merchant Center.
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 called collection.xml-sale-pricing.liquid with the following code:
{% 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: '&', '&' | 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.
7 replies on “Add Sale Price to Shopify’s Google Shopping feed”
Hi there thank you very much for this. I have followed all the steps but merchant centre says “Delimiter detection failed” when I try to fetch the feed. Any idea why? Thanks again
LikeLiked by 1 person
Hi Frederics,
The issue is usually that you didn’t select the correct collection template.
Make sure you completed the first bullet point in Step 2.
Make sure when you preview your collection you are only seeing unformatted text, and no images.
Hope this helps.
Alex
LikeLike
Hello Alex,
Thank you for getting back to me so quickly, yes you are right I have tried the steps again and discovered when I select to create a new collection template – there is a single line already there when it being setup {% section ‘collection-template’ %} – I didn’t remove this last time, but I did time and everything is fine now. This is guide is a life saver, thank you!
LikeLiked by 1 person
Hi Alex – I take it this is designed for US & CAD only. If for say UK, I need to amend to something like the following:?
{%- assign CountryCode = ‘US’ -%}
{%- if shop.currency == ‘CAD’ -%}{%- assign CountryCode = ‘CA’ -%}
{%- if shop.currency == ‘GBP’ -%}{%- assign CountryCode = ‘UK’ -%}
LikeLike
Yes, correct. Apologies for making this so north-american centric, but I couldn’t a dynamic way to map all currencies to all countries.
Don’t forget the {%- endif -%} at the end of each statement.
LikeLike
Thanks Alex. I have this all working now. Just for others, the correct code for UK is actually:
{%- if shop.currency == ‘GBP’ -%}{%- assign CountryCode = ‘GB’ -%}
I had “CountryCode = ‘UK’” before which turns out to be wrong, it needs to be “GB”
Also might be worth tweaking your article a bit Alex to make it a little clearer. When you create the Collection you need to add the products to it e.g. in my case I made it Automatic and set it to Compare At Price is Greater than 1 (so that the collection only outputs items that are on sale)
LikeLike
Thanks. I’ve added your suggestion into “step 2” and also added GBP and AUD support to the code.
LikeLike