PPCDATAFEED

How to set product_type from the category path

A rule with Split text: split the category path on its separator and keep the parts you need - the whole path, the first levels or only the last one.

product_type is your own category for each product. Google uses it to understand the catalog and you use it to split Shopping campaigns. Most stores already have it - as a path like Home > Garden > Pots.

  1. Open the data source, go to Rules and click Add rule - for example “Product type from category”.
  2. Under Then pick product_type and choose Split text.
  3. Set Take from to your category field and Split on to the separator, for example > (with the spaces).
  4. Choose the parts: Start at part 1 with Start counted from Beginning, and End at part 1 with End counted from End, keeps the whole path; 1 from the End for both keeps only the last level.
  5. Set Join with (optional) - for example > again - check Preview changes and Save rule.
Rule “Product type from category”: then product_type Split text - Take from category, Split on “ > ”, Start at part 1 counted from Beginning, End at part 2 counted from Beginning, Join with “ > ”

Example

Preview changes: category Shoes > Men > Running gives product_type Shoes > Men, Shoes > Women > Sneakers gives Shoes > Women
  • category Shoes > Men > Running, positions 1 from the Beginning to 1 from the End → Shoes > Men > Running
  • Positions 1 from the End to 1 from the End → Running
  • Positions 1 to 2 from the Beginning → Shoes > Men - the rule in the pictures
Positions are counted from 1. For Google's own taxonomy use Assign Google product categories.

Still stuck? Write to info@ppcdatafeed.com - we answer ourselves and can set it up with you.