Set up Feed Rules
Feed Rules give you the ability to transform your data to match our Product data specification requirements. Use Feed Rules to resolve errors and help us interpret the data in your feed. This article explains how to set up Feed Rules for your product data.
Before you begin
In order to use the Feed Rules feature, you'll need to first register and submit a feed in your Merchant Center account so that there is data to create rules with.
Use Feed Rules
To create a new Feed Rules for your feed:
- Navigate to the Feeds page under Products
- Select the feed you want to transform with Feed Rules
- Select the Rules tab
- Click Create Rule. If you have more than one target country and target language connected to this feed, be sure to select the country that you would like to apply the rule to.
- Select the attribute that you would like to transform with Feed Rules.
- Use the Rules Wizard to guide you to apply a rule. The Feed Rules feature works with a cascading function, which means that if you have multiple alternative rules, it will try to apply the first one first. If that does not work (because it doesn't yield a valid value), it will try the next one, and so on. Learn more about the different types of rules below.
- Click Save as draft
- If you want to save the rules, click Apply changes. Alternatively, you can click Discard changes to remove the draft rules.
- Upload, or fetch, the feed you have created the rules for to apply the new rules to your product data.
The Feed Rules page contains an Attributes table which provides an overview of target attributes covered by Rules.
Conditions can be added in front of an operation to filter items in your feed that meet certain criteria of your choosing. For example, to apply a title to all items of certain brand, you can set a condition for “brand” “equal to” “Google”.
- From the first drop-down menu, select either a feed attribute or a processed attribute to act upon. Feed attributes are specific attributes from a specific feed. If you select a feed, you’ll be able to specify the attribute name and the select the raw feed value. A processed attribute has feed rules applied.
- From the second drop-down menu, select the operator for the condition. For example, “contains” or “does not equal”.
- Then enter the value you’d like the condition to act upon. This might be a brand name, a price, or any other specific value you choose.
To enter a second condition to be combined with the first, select AND. This can be anything, so long as it doesn’t contradict the first condition. If both of the conditions are valid, the operation will be applied. For example, you may apply the rule to shirts that are red AND size small.
You can also have the rule act on conditions independently. To do this, select OR, and enter a second condition, so the rule will act on either the first or second condition. If either of the conditions entered are valid, the operation will be applied. For example, you may apply the rule to red shirts OR blue shirts.
Keep in mind
- When entering a price, use only the number without the currency.
- When using “equals”, make sure the value you enter exactly matches the value in your feed. For example, 13.00 may not be 13, $13.00, etc.
- Values are case insensitive.
Operations such as “set to” and “take latest” will only be applied if your conditions are met.
Types of rules
When setting up Feed Rules for a target attribute, you’ll have a few different options depending on the attribute and the type of data transformation needed. These options allow you to set your rules based on an existing data source, find and replace data in an existing source, or extract data from a source.
Use "Set to"
- Set an inbound column name to a specified Google attribute
- Example: Set Availability to: my_first_feed.stockstatus
- Populate a target attribute with a single, set static string value
- Example: Set Condition to: “New"
- Populate a target attribute with any combination of inbound columns, static vaues, or processed values. Use the concatenation (or combination) feature to create a string from multiple columns or values.
- Example: Set Title to: my_first_feed.brand + " " + my_first_feed.title
- Take latest of: my_first_feed.availability and my_supplemental_feed.availability
- Take latest of: my_first_feed.price and my_supplemental_feed.price
- Take latest of: my_first_feed.sale_price and my_supplemental_feed.sale_price
- Take latest of: my_first_feed.sale_price_effective_date and my_supplemental_feed.sale_price_effective_date
Legacy online inventory update feeds
If you want to use a separate feed for pricing and availability updates, you can do this by creating a supplemental feed and using the "Take latest" rule to update your primary feed.
Save Feed Rules
To save your rules and apply them to your feed, click the Apply changes button. After your changes have been applied, you will need to reprocess your feed. The new rules will appear on the newest upload on your product data, and will be applied to each upload until you make changes to the rules again.
To edit an existing rule, click on the grey box containing the rule in the Rule column. Apply any changes to the rule, and then click Apply changes to save your changes. Upload your product data to apply the edits.