Data Export & Feeds

Vanilo Cloud supports several export and feed formats that can be generated automatically on a schedule.

Each feed needs to be enabled and configured in the config/vanilo.json file. Once enabled, the data gets generated in every hour.

Sitemap

To enable sitemap generation, add the following entry to the vanilo.json config file:

{
  "cloud": {
    "export": {
      "sitemaps": [
        {
          "filename": "sitemap.xml"
        }
      ]
    }
  }
}

As the result of the above configuration, the https://yourshop.com/sitemap.xml file will be generated in every hour based on the categories and products in your shop.

Note that the sitemaps value is an array of objects, because you can define multiple sitemaps.

This can be useful if you ecommerce system runs multiple shops, channels or storefronts.

Example multi-sitemap config:

{
  "cloud": {
    "export": {
      "sitemaps": [
        {
          "filename": "sitemap_es.xml",
          "base_url": "https://mysite.es",
          "channels": ["spain"],
          "taxonomies": "*"
        },
        {
          "filename": "sitemap_pt.xml",
          "base_url": "https://mysite.pt",
          "channels": ["portugal"],
          "taxonomies": "*"
        }
      ]
    }
  }
}

Google Product Feed

To enable google product feed generation, add the following entries to the vanilo.json config file:

{
  "cloud": {
    "export": {
      "google_feed": [
        {
          "filename": "google_feed.xml",
          "shipping_method_id": 1,
          "shipping_country": "FI",
          "channels": [
            "greece"
          ],
          "base_url": "https://myshop.gr",
          "additional_image_links": 2,
          "property_map": {
            "color": "farbe",
            "material": null,
            "pattern": "motif"
          },
          "product_type": {
            "use": "taxonomy",
            "taxonomy_id": 1
          },
          "exclude": {
            "skus": [
              "10671",
              "10689"
            ]
          }
        }
      ]
    }
  }
}

Google Product Feed has shipping support, which can tell the prospects the shipping fees of specific products to their countries. Having a valid shipping data is even mandatory for certain countries.

To use this feature, you need to provide the shipping (destination) country and the shipping method ID, based on which the shipping fee gets calculated for the feed.

There are certain fields required by the Google Product Feed which need to be supplied as custom attributes. Here's the reference of how each field gets populated in the feed:

XML Field Origin
id sku
gtin gtin - if specified, omitted otherwise
title custom_attributes.google_feed.title
description custom_attributes.google_feed.description
google_product_category custom_attributes.google_feed.category
brand custom_attributes.google_feed.default_brand
availability in_stock, out_of_stock or backorder (depending on the stock field)
price original_price (if available) or price if no original_price was set
sale_price price if original_price exists, skipped otherwise
identifier_exists yes if GTIN is available, no otherwise
color If the product has a color* property, its label will be used
material If the product has a material* property, its label will be used
pattern If the product has a pattern* property, its label will be used
item_group_id The id of the master product in case of product variants

*: See the Property Mapping part below for customization

Prices

The Google Merchant Feed format supports two fields for prices: [g:price] and [g:sale_price].

If a product has both the original_price and the price fields set, then the generated XML feed will contain both the [g:price] and the [g:sale_price] fields.

If there's no original_price set for a given product, then only the [g:price] field is generated:

Product Has Original Price No Original Price
price field [g:sale_price] [g:price]
original_price field [g:price] → not used

Property Mapping

The Google Feed supports color, material and patten fields which Vanilo can take from Product properties. Depending on how you name your properties, it might be needed to define which property represents these fields for the Google XML feed. For this purpose, the property_map config can be used.

If you set a value for the property_map.color key, then the value will be used as the property based on which the color value will be looked up, in this example, the farbe property:

{
  "cloud": {
    "export": {
      "google_feed": [
        {
          "property_map": {
            "color": "farbe",
            "material": null,
            "pattern": "motif"
          }
        }
      ]
    }
  }
}

If a value is set to null, then that will be omitted from the XML

Product Type

It is possible to populate the Google Merchant Product Type field in the generated XML file.

This field is omitted by default, add the following configuration to enable populating it:

{
  "cloud": {
    "export": {
      "google_feed": [
        {
          "product_type": {
            "use": "static_text",
            "text": "Home > Men > Shoes > Sneakers"
          }
        }
      ]
    }
  }
}

The configuration above will add the static text Home > Men > Shoes > Sneakers to each product item as the product_type field in the generated XML.

To make the field dynamic for each product, it is possible to use one of the category trees (aka taxonomy) as a value:

{
  "cloud": {
    "export": {
      "google_feed": [
        {
          "product_type": {
            "use": "taxonomy",
            "taxonomy_id": 1
          }
        }
      ]
    }
  }
}

The configuration above will use the first assigned taxon and its parents of the given taxonomy for each product in the generated XML feed.

The URL of the primary image of each product is added to the feed as the xmlns:g:image_link field.

The image link field is mandatory as per Google's Specification, and it shouldn't be a generic image, except for a several product categories.

By default, only a single image URL gets added to the feed, but it is possible include up to 10 additional images.

To enable this, set the additional_image_links configuration entry:

{
  "cloud": {
    "export": {
      "google_feed": [
        {
          "filename": "google_feed.xml",
          "additional_image_links": 3
        }
      ]
    }
  }
}

The setting above will add 3 xmlns:g:additional_image_link entries to the generated XML feed. If the product has fewer images than requested, then there will be as many included as available.

The primary product image is always excluded from the additional image list.

Product Exclusion

Products can be excluded from the feed by adding their SKUs to the configuration:

{
  "cloud": {
    "export": {
      "google_feed": [
        {
          "exclude": {
            "skus": [
              "10671",
              "10689"
            ]
          }
        }
      ]
    }
  }
}