How to use Product Feeds for Shopify?
STEP 1: Configure your data feeds with Product Feeds for Shopify
To create and configure your data feeds, go to:
ShopifyApplicationsProduct FeedsData Feeds
Your data feeds will be listed in the grid.
You will find the file's name and link to the file. You should also get a message that sums up the number of products exported and the number of errors and warnings in your data feed.
The status of your data feed will vary according to the situation:
- Error: the generation is stopped
- Pending: the data feed has never been generated or the scheduled hour is passed
- Processing: the data feed is processing, and there is a generation progression percentage
- Scheduled: the data feed is scheduled
- Success: the data feed has been successfully generated, manually or automatically (the generation corresponds with a schedule)
- Disabled: the data feed is disabled
From the Action you'll be able to:
- Edit
- Preview
- Generate
- Delete
Click on + Create a new data feed to configure your data feed as you want.
Settings
In that first tab is the main configuration of the data feed. To customize your feed, you'll find several fields to fill in.
- Data feed status
Enable or disable the data feed. - Status
It displays the current status of the data feed. - Name
Enter a name for the data feed. - File Name
Enter the name for the file. - Language
Define the language that will be used for the product placeholders.
Template
The Product Feeds app for Shopify includes a preview tool to help you configure your feed and see what is wrong very quickly.
Product pattern
Placeholders library
Data feed preview
Report
You can get reports on the errors and warnings of your data feeds.
This will help you save time by quickly identifying the main problems of your data feed and making the necessary changes.
- In red will be displayed the error that you must correct to be able to submit your data feed:
Missing required attribute: google_product_category. - In orange will be displayed the warningsMissing recommended attribute: product_type.
to these errors or warnings, you should see the number of concerned items.
Collections - filter type
In the Collections tab, you can filter your collections according to two different ways:
- Include products from selected collections.
- Exclude products from selected collections.
Collections - selection and mapping
In that subtab, you can select and map your collections to Google categories. This step is very important so that Google can make a link between their product categories and your collections.
What is category mapping?
The Google product taxonomy is a tree of categories that will help you generate values for the Google product category placeholder listing all possibilities.
Categories names you are using in your Shopify shop aren't always the same as the ones used by Google Merchant to reference your products.
This means you have to find out which Google Merchant categories have the best matching with your collections, according to the Google product taxonomy.
For example, if you're selling furniture like coffee tables, you'll have a Coffee table collection in your Shopify back-office. But Google Merchant doesn't handle this kind of category. The closest Google product category could be Kitchen & Dining Room Table.
So this should appear this way in your data feed:
<g:google_product_category>Furniture > Desks & Tables > Kitchen & Dining Room Tables</g:google_product_category>
How to map your collections to Google categories?
Simple Google Shopping for Shopify provides you with an easy way to input Google product categories that are matching your collections.
In your data feed configuration, go to the Collections tab. Then, in the Collections selection and mapping section, you'll find a tree view of all your collections.
First, select the Google Taxonomy source on which the category mapping is based.
Taxonomy files for the main countries are directly included in the app to allow you to map your collections more easily. You can also have a look at the below documentation to know how to add a new taxonomy file.
For each collection, you have a little arrow followed by mapped as.
There, you'll be able to start typing a keyword in order to display a list of all categories including that keyword. You simply need to select the one you need.
Once all your collections are mapped, you can click on the Save button.
Here are a few guidelines for choosing the most appropriate category:
- Use the category that best describes your item. To do this, first determine the primary function of the products you are submitting. For specific items like MP3 Players, select the MP3 Players category. While some MP3 players can also serve different functions, like those that contain a clock, they are primarily MP3 Players.
- Use only one category. For some products, more than one category might be relevant. For example, an adapter to allow an MP3 player to be used in a car could be in both categories Motor Vehicles > Audio & Video and Electronics > Audio > Audio Accessories > MP3 Player Accessories. In such cases, you should choose the category that seems the most appropriate to you, but do not include more than one.
- Use the most specific category possible. Being specific will help improve your data quality and in turn ensure that offers are presented in the right category. When viewing the taxonomy, try to navigate to the most specific category that still covers all the products being submitted. For instance, if you are submitting MP3 player chargers use the category MP3 Player Chargers. Conversely, if you are submitting multiple types of chargers use the category Chargers.
How to include the Google category in the XML template?
Finally, so that the Google category is retrieved in your data feed, you must add the following placeholder to the XML template:
<g:google_product_category>{{googleProductCategory}}</g:google_product_category>
Read also: https://support.google.com/merchants/answer/6324406?hl=en
Filters
Simple Google Shopping for Shopify also allows you to filter your products on several levels.
Product types
First of all, you can choose to include products in your feed according to their types:
- Include main products
- Include variant products
Advanced Filters
- IS / IS NOT
name is %shirt: will include all products whose name ends with 'shirt'.
name is not %shirt: won't include any product whose name ends with 'shirt'.
- IS ONE OF / IS NOT ONE OF
Size is in S L: will include only products from these 2 sizes.
Size is not in S L: will include all products whose size is not S or L.
- IS NULL / IS NOT NULL
Color is null: will include all products that don't have color. Color is not null: will include all products whose color is not null.
Schedule
Simple Google Shopping for Shopify provides you with a fully configurable schedule in:
ShopifyApplicationsSimple Google ShoppingSchedule Settings
From this section, you can define when the data feeds must be updated.
- Data feeds generation schedule times
Define the scheduled times when the data feeds will be generated and updated.
You can select up to 4 schedule times. For more schedule options, you can update your plan. - Cache status
The cache is updated each time the schedules run, and it will then be used in the data feed previews.
STEP 2: Generate and download the data feeds
Generate the data feeds
Simple Google Shopping for Shopify allows you to generate the data feeds manually or automatically.
Manually
You can generate your data feeds manually from the action the data feeds grid.
You also have the possibility to do it from the configuration panel by clicking on Generate.
With the cron tasks
Download the generated data feed
When a data feed is ready to be downloaded, the link is displayed in:
- the data feeds grid
- the data feed Settings tab
To download the data feed, select Save link as after clicking on the link (right-click).
Manage your data feed templates
10 Things to know when creating an XML data feed Product Feeds for Shopify
- An XML data feed is using opening and closing tags that include a value.
<g:id>123456</g:id> <price>45.99 USD</price>
- A data feed template is made of several tags including dynamic or fixed values.
<g:id>{{sku}}</g:id> <g:brand>Fixed Brand</g:brand>
- Dynamic values are called placeholders and use the placeholder codes of your Shopify website preceded with the object. The placeholder must be enclosed using double brackets.
<g:id>{{sku}}</g:id> <price>{{price}}</price>
- You can include some fixed values between every opening and closing tag. Fixed values are simply text.
<g:brand>YOUR BRAND</g:brand>
- You have also the possibility to add several placeholders and fixed values in tag.
<title>{{name}}, available in {{color}} for only ${{price}}</title>
- Some placeholders may have further configuration options or parameters that will correspond to your specific data feed needs.
<availability>{{availability out_of_stock='not available' in_stock='available' backorders='available'}}</availability>
- You're allowed to transform the output of the placeholders thanks to custom functions. Check the list of all available functions.
<g:shipping_weight> {{weight output="float($self,2)"}}kg </g:shipping_weight>
- The syntactic coloration in Product Feeds for Shopify will also help you to avoid many errors in your pattern.
- You can use one or more fallback placeholders in case the previous is empty or null. If placeholderA exists then the value will be placeholderA, otherwise, the value will be placeholderB...
{{color self | colour parent}}
- CDATA is recommended. CDATA stands for Character Data. It means that the data in between these tags include data that could be interpreted as XML markup but should not be (Wikipedia article).
<description> <![CDATA[<p>Fantastic <b>Watch</b>, that not only tells you what time it is,but also gives the weather trends</p>]]> </description>
Shopify smart placeholders specifications
The data feed pattern is totally customizable.
OBJECTS
In order to retrieve the value of a placeholder, you need to define which object is targeted. Below are the different types of objects that you can use.
{{placeholderCode}}
Retrieves the value from the variant or inherits it from the parent if the variant doesn't have any value for the given smart placeholder.
For example:
{{sku}}
{{title}}
{{placeholderCode parent}}
Retrieves the value from the parent for the given smart placeholder.
For example:
{{description parent}}
{{placeholderCode self}}
Retrieves the value from the variant or the parent for the given smart placeholder. If the variant doesn't have any value then nothing is returned.
For example:
{{description self}}
PRODUCT IDENTIFIERS
You'll find below the smart placeholders most commonly used to identify the products in data feeds patterns.
{{id}}
Retrieves the product id as it appears in the URL from the back office product page.
For example:
{{id}}
{{sku}}
{{barcode}}
Retrieves the barcode of the product available from the back office product page.
{{barcode}}
{{hsCode}}
Retrieves the harmonized system code of the product available from the back office product page.
{{hsCode}}
LINKS
Below are the smart placeholders generally used to retrieve links.
{{uri}}
Retrieves the product's canonical relative URL.
For example:
https://www.mywebsite.com/mystore_code/{{uri}}
{{url}}
Retrieves the product’s canonical absolute URL.
For example:
{{url}}
BASIC INFORMATION
You'll find below the smart placeholders that are generally used to define basic information about products in the data feeds.
{{status}}
Retrieves the status of the product available from the back office product page.
{{status}}
{{title}}
Retrieves the name of the product available from the back office product page.
{{title}}
{{description}}
Retrieves the description of the product available from the back office product page.
You also have the possibility to use some parameters with this placeholder:
- html = use 1 or 0 to retrieve the description with or without HTML code
{{description html="1"}}
METAFIELDS INFORMATION
If you're using metafields, you can use the following smart placeholders.
{{namespace.metafield}}
Retrieves a metafield by namespace and key that belongs to the resource.
{{mm-google-shopping.age_group}}
PRODUCT ORGANIZATION INFORMATION
{{vendor}}
Retrieves the vendor for the product available from the back office product page.
{{vendor}}
{{type}}
Retrieves the type for the product available from the back office product page.
{{type}}
{{tags}}
Retrieves the tags for the product available from the back office product page.
You also have the possibility to use some parameters with this placeholder:
- nth = nth of tags to retrieve.
Default value: * (all)
Possibles values: list of unsigned integers, negative integers, integers prefixed with an exclamation mark - separator = is the separator of the tags.
Default value: , (comma)
{{tags nth=”1,2,3” separator=”,”}}
{{collections}}
Display the collections associated with the product available from the back office product page.
In order to display a specific collection you have the possibility to use a parameter with this placeholder:
- nth = display the nth collection
Default value: the 1st collection is used by default.
Possibles values: negative values are allowed. - separator = is the separator of the collections
{{collections nth="1,2,3" separator=","}}
{{collections nth="-1,-2" separator=","}}
{{collectionMappings}}
Retrieves collections mapping associated with the product (in the Collections tab).
If no mapping is assigned to the first collection found, the second collection will be used, etc…
You also have the possibility to use some parameters with this placeholder:
- nth = display the nth collection
Default value: the 1st collection is used by default.
Possibles values: negative values are allowed. - separator = is the separator of the collections
{{collectionMappings nth="1,2,3" separator=","}}
{{collectionMappings nth="-1,-2" separator=","}}
VARIANT AND OPTION INFORMATION
{{option.names}}
Retrieves the option names available from the back office product page.
You also have the possibility to use some parameters with this placeholder:
- nth = display the nth name
Default value: the 1st name is used by default.
Possibles values: negative values are allowed. - separator = is the separator of the names
{{option.names nth="1,2,3" separator=","}}
{{option.name}}
Retrieves the option values available from the back office product page for a given option name.
You also have the possibility to use some parameters with this placeholder:
- nth = display the nth value
Default value: the 1st value is used by default.
Possibles values: negative values are allowed. - separator = is the separator of the values
{{option.color nth="1,2,3" separator=","}}
MEDIA
{{imageUrl}}
Retrieves the URL of the image for the product.
You also have the possibility to use some parameters with this placeholder:
- nth = the nth image
Default value: the 1st image is used by default.
For example:
{{imageUrl nth="2"}}
{{imageAlt}}
Retrieves the alternative text of the image for the product.
You also have the possibility to use some parameters with this placeholder:
- nth = the nth image
Default value: the 1st image is used by default.
For example:
{{imageAlt nth='2'}}
{{image_name}}
Retrieves the name of the image for the product.
You also have the possibility to use some parameters with this placeholder:
- nth = the nth image
Default value: the 1st image is used by default.
For example:
{{image_name nth='2'}}
PRICES AND PROMOTIONS
Below is a list of the price smart placeholders that you can use in your feed pattern. For most of them, you can add some parameters in order to define the currency used or the VAT to apply for example.
{{normalPrice}}
Retrieves the normal price available from the back office product page in the default shop currency.
You also have the possibility to use some parameters with this placeholder:
- currency_rate = automatically converts the original product price to a specified currency. It uses an exchange rate that you have already stored in your Shopify admin panel. By default, your local currency is used.
- vat_rate = is a floating value between 0.00 and 100.00 that represents an arbitrary VAT rate to apply. This parameter rewrites the VAT rule for the product except if the product doesn't have any tax class.
- market = is the ISO code for the targetted market.
For example:
{{normalPrice currency_rate=”EUR” vat_rate=”20” market=”FR”}}
{{normalPrice currency_rate=”GBP” vat_rate=”0” market=”UK”}}
{{specialPrice}}
Retrieves the special price of the product available from the back office product page.
{{specialPrice}}
{{hasSpecialPrice}}
Retrieves yes or no if the product has a special price.
You also have the possibility to use some parameters with this placeholder:
- yes = the value to retrieve if the product has a special price
- no = the value to retrieve if the product has no special price
For example:
{{hasSpecialPrice yes="YES" no="NO"}}
{{hasPromotionPrice}}
Retrieves yes or no if the product has a discount price.
You also have the possibility to use some parameters with this placeholder:
- yes = the value to retrieve if the product has a discount price
- no = the value to retrieve if the product has no discount price
For example:
{{hasPromotionPrice yes="YES" no="NO"}}
{{min_price}}
Retrieves the product's minimum price.
For example:
{{min_price}}
{{max_price}}
Retrieves the product's maximum.
For example:
{{max_price}}
{{promotionName}}
{{unitPrice}}
Retrieves the unit price for the product available from the back office product page.
For example:
{{unitPrice}}
{{unit}}
Retrieves the unit for the product available from the back office product page.
{{unit}}
{{cost}}
Retrieves the cost of the product available from the back office product page.
{{cost}}
SHIPPING INFORMATION
{{weight}}
Retrieves the weight of the product available from the back office product page.
{{weight}}
{{weightUnit}}
Retrieves the weight unit of the product available from the back office product page.
For example:
{{weightUnit}}
INVENTORY
The below smart placeholders are often used to retrieve the availability of your products, for the quantity.
{{trackQty}}
Retrieves yes or no if the quantity is managed for the product.
You also have the possibility to use some parameters with this placeholder:
- yes = the value to retrieve if quantity is managed for the product
- no = the value to retrieve if quantity is not managed for the product
For example:
{{trackQty yes="Quantity managed" no="Quantity not managed"}}
{{backordersAllowed}}
Retrieves yes or no if backorders are allowed for the product.
You also have the possibility to use some parameters with this placeholder:
- yes = the value to retrieve if backorders are allowed for the product
- no = the value to retrieve if backorders are not allowed for the product
For example:
{{backordersAllowed yes="Backorders allowed" no="Backorders not allowed"}}
{{qty}}
Retrieves the quantity for the product.
You also have the possibility to use some parameters with this placeholder:
- location = name of the location
For example:
{{qty location="warehouse"}}
{{availability}}
Retrieves the availability of the product.
You also have the possibility to use some parameters with this placeholder:
- in_stock = value when the product is in stock
Default value: in stock. - out_of_stock= value when the product is out of stock
Default value: out of stock. - = value when the product is out of stock but allows backorders
Default value: backorders.
For example:
{{availability in_stock="available" out_of_stock="not available" backorder="available"}}
GENERAL PARAMETERS
Below are all the parameters you can use with any placeholder in your data feeds.
{{placeholder if="condition"}}
The if parameter allows you to define one or more necessary conditions to display the given placeholder in the data feed.
One condition is built with 3 items:
- the variable to check :
a product placeholder - the comparison statement
== equal
<= lower or equal to
=> higher or equal to
< lower than
> higher than
!= different from
... - the value
For example:
<!-- Product description will be displayed only if product SKU is banana -->
{{description if="this.sku=banana"}}
{{placeholder prefix="value"}}
The prefix is what will be displayed before the placeholder value only if it is not null, nothing is retrieved.
For example:
<!-- Currency symbol will be added before the price -->
{{price prefix="$"}}
{{placeholder suffix="value"}}
The suffix is what will be displayed after the placeholder value only if it is not , nothing is retrieved.
For example:
<!-- Currency symbol will be added after the price -->
{{price suffix=" USD"}}
{{placeholder output="functions"}}
The output parameter allows you to define the output format for a given placeholder using the basic functions, or any functions.
You must refer to the placeholder by using the $ as the function's parameter.
For example:
<!-- Gets the first letter of each word of the product name in uppercase -->
{{name output="ucwords($self)"}}
If you want to use several functions, they must be imbricated as you do with PHP:
For example:
<!-- Removes all HTML tags from the description and limits the description to the first 100 characters -->
{{description output="substr(strip_tags($self),0,100)"}}
You can also use null to display an empty string, or you can use any string to display a specific message:
For example:
<!-- Displays "Free Shipping" if product price is greater than $10 -->
{{price if="price>10" output="'Free Shipping'"}}
FUNCTIONS
You can use any of the native placeholders that are defined in your Shopify back-office
The syntax to use in order to include functions in the variables is:
{{placeholder output=”function(parameters)”}}
You can also apply one or more functions to all of these placeholders by using the following syntax:
{{placeholder output=”function1(function2(function3($self,parameters)))”}}
All options are executed in the written order:
<title>{{name}}</title>
<title>{{name output="strtoupper($self)"}}</title>
<title>{{name output="strtoupper(substr($self,15,'...'))"}}</title>
This will produce:
<title>V-Neck T-Shirt</title>
<title>V-NECK T-SHIRT</title>
<title>V-NECK T-SHI...</title>
str_replace($self)
Replaces the value with another one.
For example:
<g:title>{{name output="str_replace($self,"Banana","Apple","Banana skirt")"}}</g:title>
strtoupper($self)
Converts all characters to uppercase.
For example:
<g:title>{{name output="strtoupper($self)"}}</g:title>
strtolower($self)
Converts all characters to lowercase.
For example:
<g:title>{{name output="strtolower($self)"}}</g:title>
ucfirst($self)
Converts the first character to uppercase.
For example:
<g:title>{{name output="ucfirst($self)"}}</g:title>
ucwords($self)
Converts the first character of each word to uppercase:
For example:
<g:title>{{name output="ucwords($self)"}}</g:title>
substr($self,$length,$end)
Truncates the value.
You need to define some parameters:
- length = maximum length of the value
- end = string that will be added at the end of the string
By default: ...
For example:
<description> {{description output="substr($self,50,'...')"}} </description>
If there are HTML tags in your descriptions, you may need to use strip_tags in combination with this function:
<description> {{description output="strip_tags(substr($self,50,'...'))"}} </description>
strip_tags($self)
Strips the string from HTML tags.
For example:
<description> {{description output="strip_tags($self)"}} </description>
htmlentities($self)
Converts all applicable characters to HTML entities.
For example:
<description> {{description output="htmlentities($self)"}} </description>
html_entity_decode($self)
Converts a string that has been HTML-encoded for HTTP transmission into a decoded string.
For example:
<description> {{description output="html_entity_decode($self)"}} </description>
float($self,$decimal)
Converts a numeric value to a floating number.
You need to define some parameters:
- decimal = number of floating numbers. By default: 0
For example:
<g:shipping_weight> {{weight output="float($self,2)"}}kg </g:shipping_weight>
cleaner($self)
Removes all characters that don't belong to the UTF-8 charset.
For example:
<g:title>{{name output="cleaner($self)"}}</g:title>
inline($self)
Removes all EOL characters from the value.
For example:
<description> {{description output="inline($self)"}} </description>
implode($separator,$self)
Joins all array elements in a string.
You need to define some parameters:
- separator = string used between each value. By
This function may be useful for multi-select placeholders like climate, activity general...
For example:
<activity> {{activity_general output="implode('-',$self)"}} </activity>
Will give: Outdoor-Running-Warmup-Lounge-Gym