# Migrate to feed labels

You can use the
[`feedLabel`](https://developers.google.com/shopping-content/reference/rest/v2.1/products#Product.FIELDS.feed_label)
field to add a label to your products and datafeeds.

Feed labels can have the following format:

- Type string
- Less than or equal to 20 characters
- Uppercase letters (A-Z)
- Numbers (0-9)
- Dashes (-)

`feedLabel` is available in the following resources:

- [`products`](https://developers.google.com/shopping-content/reference/rest/v2.1/products)
- [`datafeeds`](https://developers.google.com/shopping-content/reference/rest/v2.1/datafeeds)
- [`datafeedstatuses`](https://shopping-content/reference/rest/v2.1/datafeedstatuses)

## REST ID

`feedLabel` replaces
[`targetCountry`](https://developers.google.com/shopping-content/reference/rest/v2.1/products#Product.FIELDS.target_country)
in [REST IDs](https://developers.google.com/shopping-content/guides/products/product-id) for new products.

Instead of `online:language:targetCountry:offerId`, the REST ID is now formed as
`online:language:feedLabel:offerId` for new products. This doesn't change the
REST ID of your existing products.

## Get and list products

The `feedLabel` field is always populated for all returned products.

If `feedLabel` is a valid CLDR territory code, we automatically backfill the
`targetCountry` field for compatibility. If the `feedLabel` isn't a valid CLDR
territory code, we leave `targetCountry` empty.

> [!WARNING]
> **Warning:** Backfilled `targetCountry` values don't enable your products to serve in the provided country. Make sure all countries you want to target are included in the `shipping` field.

The same changes apply for `productstatuses` endpoints.

Country-specific fields are empty for offers with a `feedLabel` that isn't a
CLDR territory code.

## Insert and update products

Either `feedLabel` or `targetCountry` is required to insert new products. If you
insert or update products with a `feedLabel` and `targetCountry`, their values
must match.

You receive an error from the API if the fields are both empty, or if their
values don't match.

See [Use feed labels to advertise products from specific
feeds](https://support.google.com/merchants/answer/12453549) for more details.

## Country targeting

Use one of the following to ensure your products target the right countries:

- [`shipping`](https://developers.google.com/shopping-content/reference/rest/v2.1/products#Product.FIELDS.shipping) field of the `products` resource
- [`targetCountries`](https://developers.google.com/shopping-content/reference/rest/v2.1/datafeeds#DatafeedTarget.FIELDS.target_countries) field of the `datafeeds` resource

### Products

The `targetCountry` field for `products` is deprecated. Instead, use the
`shipping` field to specify your target countries.

If you want to [target multiple
countries](https://developers.google.com/shopping-content/guides/targeting-ads-in-multiple-countries), you
can continue to use `shipping` to add additional countries.

See [Targeting ads in multiple
countries](https://developers.google.com/shopping-content/guides/targeting-ads-in-multiple-countries) for
more information.

### Datafeeds

You can now see which countries a `datafeed` explicitly targets in
[`targets`](https://developers.google.com/shopping-content/reference/rest/v2.1/datafeeds#resource:-datafeed).
This applies when you use `feedLabel` instead of `country` in the
`datafeedtarget` configuration.

We've also added the `targetCountries` field for `datafeeds`, so you can
configure targeting for `datafeeds` directly. You can still configure targeting
outside the feed, for example, by setting the `shipping` attribute of the
products resource.

## UK to GB conversion

We currently allow the `UK` value for the `targetCountry` field even though it's
not a valid country code. We automatically convert `UK` to `GB`. Products with
`UK` as their `targetCountry` are stored with `GB` in their REST ID and
`offerId`.

If you set `UK` as the value for `feedLabel`, it is not automatically converted
to `GB`. `UK` and `GB` are different strings for `feedLabel` and will create
different offers.

If you insert a `targetCountry` of `UK`, and we convert it to `GB`, you must
update the REST ID of the product to include `GB` instead of `UK` to retrieve
the product with the `get` method.