How Can We Help?

< All Topics
Print

Adding Sale Price to Google Feeds | How to Guide

The price + sale_price mechanism is built into all the ‘Expanded Fields’ versions of the Google format based feed templates so this can be viewed and tested by using one of the following templates as the starters for one of your feed builds:

  • Google Shopping | Expanded Fields
  • Facebook Ads | Expanded Fields
  • Pinterest Catalogs | Expanded Fields
  • Microsoft Ads | Expanded Fields

This tutorial will explain how that mechanism works though and its actually a good case study for how the variables function works also, so its worth explaining in more detail.

To begin with the feed specification requirement we are seeking to adhere to can be described as folllows

There is a mandatory requirement for the field ‘price’ and there is an optional attribute of ‘sale_price’ which gives you the ability to show where a price reduction/ crossed price exists.

So in a feed this might look something like this:

Construction wise therefore, for all the ‘non sale’ items we want to show the variant_price (Shopify field) in the feed ‘price’ column & for items ‘in sale’, the compare_at_price (Shopify field) is shown in the feed ‘price’ column and the variant_price (Shopify field) moves to the feed ‘sale_price’ column.

It is important for optimum conversion to build this into your feeds where you selling items with a price reduction/ promotional price, this will flow through to your product listing ads shown in SERPs .. your ads will show a crossed price + sale price and also will be tagged with an image overlay to show that there is a price drop applied.

The method to achieve this in Feed Donkey is fairly simple, but we need to utilise the variables function. Firstly we create two variables to represent the variant price plus the variant compare price. Then in the builder we use map rules (conditional tests of the data) to deliver these to the correct feed columns.

So firstly we go to the Variables tab and create these two variables:

Then in the column builder we create firstly the ‘price’ column and the config will look like this

So a couple of points about the above. You can see that in the logical test, we are representing the value for variant price as a ‘shortcode’ .. so any variable created can be ‘used’ in this form. The format is dollar sign, followed by the variable header name wrapped in parentheses.

${variable_header_name}

We created variant_price as variable in the previous step so we can use ${variant_price} in the map rules conditional test.

Also you can see that variables are selectable in the pull down boxes where we configure the ‘Value’ (where the conditional test is met) & ‘Default’ (where is it is not)

So this map rule is now set and this is how we achieve a dynamic feed. In the feed ‘price’ column here a SKU has a compare price that is greater than the variant price we show the compare price, where it does not (where it does have a compare at price or that value is not greater than the selling price) we show the selling price (standard variant price).

The other element of note here is that we are showing the ISO 4217 currency code along with the price/ compare at price values (in this case USD).

This is simply a composite static value added on (Space separated from the result of the Map rule). As we are adding this as a static value every SKU result will have Space”USD” added on to the end of whatever the map rule returns here. This is OK here as there will be no scenario where there will be a null/ blank result from the Map rule – it will always return something either the compare price if it meets the conditions of the test, if not the variant price. This is not the case for the ‘sale_price’ column i.e. sometimes we will be wanting to show a blank in this column (if its a non sale item), so we will need to do something different here – I will explain in the next step.

So finally the ‘sale_price’ column

So the map conditional test is the same as in the ‘price’ column but the difference here is that we need to be delivering the selling price where the condition is met (i.e. it is a SKU with a reduced price). Now as mentioned in previous paragrah we cannot just use a standard static value to append the ” USD” to the price value as in some instance we want to have a blank value in this column. We get around this by using the ‘Custom’ option for the mapped ‘Value’ – this allows us to use the shortcode for variant price plus the currency code append, we only then populate this column where the condition of the map rule is met.

Hope this helps you to build better feeds, of course we are happy to assist with any of your feed building conumdrums whatever they might be. Just reach out to us over the usual support channels!