Tag Archives: content_api

Changes to Content API request validation

What’s changing?

The Content API for Shopping will gradually roll out improvements to request validation from January 1, 2021 to February 15, 2021. These changes will be applied to a growing percentage of requests during that time, reaching 100% by February 15, 2021. The validation improvements will ensure that certain requests that are not in the proper format result in an error instead of having the Content API attempt to infer the request's intent. As long as you are submitting the proper type and structure for each field, you will not be affected by this change.

The following sections describe two examples of incorrectly formatted requests that may fail after January 1st, 2021. If your requests start to fail after January 1st, 2021, please refer to the error message returned and correct the formatting issue.

Example: Providing an invalid structure for a repeated field

This error applies to providing any invalid type for a repeated field, such as providing a list of objects instead of a list of strings, or vice versa.

Example invalid v2.1 request

The following request is invalid because the includedDestinations field requires a list of strings, not a list of objects:

{
"targetCountry": "US",
"offerId": "123",
"contentLanguage": "en",
"channel": "online",
"includedDestinations": [{"destinationName": "Shopping", "intention": "default"}]
}

Example valid v2.1 request

To correct this issue, change the list of objects to a list of strings:

{
"targetCountry": "US",
"offerId": "123",
"contentLanguage": "en",
"channel": "online",
"includedDestinations": ["Shopping", "SurfacesAcrossGoogle"]
}

Other common fields affected by this change

  • v2.1:
    • product.excluded_destinations (a common mistake is providing the v2 format of this field for requests to v2.1)
  • v2:
    • product.destinations (a common mistake is providing the v2.1 format of this field for requests to v2)
    • product.sizes
    • product.additional_image_links
    • product.shipping

Example: Submitting a string that represents a float instead of an integer

This error applies to providing a string containing a floating point number when an integer is required.

Example invalid v2.1 request

The following request is invalid because the sellOnGoogleQuantity requires a string in int64 format, but the string “100.0” is a float:

{
"targetCountry": "US",
"offerId": "123",
"contentLanguage": "en",
"channel": "online",
"sellOnGoogleQuantity": "100.0"
}

Example valid v2.1 request

To correct this issue, change the value to an integer:

{
"targetCountry": "US",
"offerId": "123",
"contentLanguage": "en",
"channel": "online",
"sellOnGoogleQuantity": "100"
}

Other common fields affected by this change

  • v2.1:
    • product.unit_pricing_base_measure.value
  • v2:
    • inventory.sell_on_google_quantity
    • product.unit_pricing_base_measure.value

What do I do?

We recommend that you address any incorrectly formatted requests before January 1st, 2021 to avoid any disruptions to your application.

If you are already submitting the proper type for each field as described in the Content API for Shopping reference docs, no action is required.

Need More Help?

If you have any questions or need assistance, please reach out to us on the forum.

Sunset approaching for v2 of the Content API for Shopping

We are writing to remind you that the Content API for Shopping v2 will sunset on March 29, 2021. On this date, all requests made against v2 of the Content API will fail. Please migrate to v2.1 as soon as possible to ensure your applications are unaffected.

To help with the migration to v2.1, we have prepared the following resources:

  • Migration guide -- Explains how to update your applications for v2.1.
  • Supplemental feeds guide — In v2.1, supplemental feeds replace the v2 inventory service for partial updates to online products.
  • Local inventory service guide — In v2.1, the local inventory service replaces the v2 inventory service for updates to local inventory.
  • Release notes -- Lists all changes and new features added in v2.1, organized by release date.

If you have questions about the migration or encounter challenges that prevent you from migrating, we want to hear from you. Please reach out to us on the forum so we can help.

Use the Content API for Shopping to serve Shopping ads and free listings in multiple countries

What's changed for Shopping ads

In August 2020, we simplified how you use product data across countries. In the past, you needed to submit duplicate products with separate targetCountry values for each country in which you wanted to serve Shopping ads. Now you can simply configure additional countries of sale for each primary feed in Google Merchant Center to serve ads for the same product in multiple countries. You can also add additional countries on a per-product basis by using the shipping field.

What's changed for free product listings

In October 2020, we announced that free listings will soon be available across the world. We also removed the ability to use account-level shipping settings to allow ads and free listings to be served in multiple countries. For more information, see the Merchant Center announcement: Use additional countries to determine your reach.

What you should do

As a result of these recent enhancements, we recommend that you do the following when serving ads and listing your products in multiple countries:

  • Stop submitting duplicate products with separate targetCountry values for each country you want to advertise in.
  • If you want all of the products in your primary feed to be eligible for ads and free listings in multiple countries, add the additional countries to the feed in Merchant Center.
  • If you only want specific products to be eligible for ads and free listings in multiple countries, add the additional countries on the shipping field of each product.

Check out our Content API guide, Targeting Shopping ads and free listings in multiple countries, for examples and additional details.

If you have any questions or need assistance, please reach out to us on the forum.

Content API upgrading authorization scope to "sensitive"

Beginning October 1, 2020, any new Google Cloud app with a unique OAuth 2.0 Client ID used to obtain credentials for the Google Content API scope (https://www.googleapis.com/auth/content) in its projects will need to undergo a Google OAuth verification to avoid an unverified app screen for its users. Users of unverified apps that access the Content API will see warnings and the apps will have limited functionality.

There is no cost for app verification and the process typically takes 3 to 5 business days. For more information about how app verification fits into the broader process of authorizing requests, see our Using OAuth guide.

Apps already using the Content API scope prior to October 1, 2020 are not currently affected by this policy. However, this policy will be applied to all apps at a later date in 2021, and we recommend that all apps undergo the Google OAuth verification process at their earliest convenience to avoid any business interruptions.

For more information about app verification, see OAuth API verification FAQs. If you have any questions or need additional help, please reach out to us on the forum.

Sunset of v2 for the Content API for Shopping

The Content API for Shopping v2 will sunset on March 29, 2021. On this date, all requests made against v2 of the Content API for Shopping will fail. Please migrate to v2.1 as soon as possible to ensure your applications are unaffected.

To help with the migration to v2.1, we have prepared the following resources:
  • Migration guide -- Explains how to update your applications for v2.1
  • Supplemental feeds guide — In v2.1, supplemental feeds replace the v2 inventory service for partial updates to online products.
  • Local inventory service guide — In v2.1, the local inventory service replaces the v2 inventory service for updates to local inventory.
  • Release notes -- Lists all changes and new features added in v2.1, organized by release date.
If you have questions about migration, please reach out to us on the forum.

Entity IDs as 64-bit in AdWords API, Google Ads API beta, Google Ads scripts, and Content API for Shopping

In the AdWords API, the Google Ads API beta, Google Ads scripts, and the Content API for Shopping, all entity IDs are 64-bit signed integers. They are of type:
  • xsd:long in the AdWords API
  • INT64 in the Google Ads API
  • number or string in Google Ads scripts
  • string in REST and as INT64 for client libraries in Content API for Shopping
Applications that integrate with the API should handle ID values in that range.

Historically, the following IDs were within the maximum value of 32-bit signed integer, but will soon be exceeding this range. Over the years, all of you have been so productive that we need to make sure 64-bit signed integers are available to allow the creation of more entities with unique IDs. This was announced starting in July 2019. To avoid any issues, please make sure your applications handle these IDs within a range of 64-bit signed integer values. Also make sure that your application is ready to support a 64-bit signed integer for any other entity IDs not listed below.

Which IDs are affected in the AdWords API and the Google Ads API beta?
AdWords API Google Ads API beta
Bidding Strategy BiddingStrategyConfiguration.bidding_strategy_id

BiddingStrategyId (multiple reports)
BiddingStrategy.id
Budget BudgetOrder.id AccountBudget.id

BillingSetup.id
User List UserList.id

CriterionUserList.userListId

CLICK_PERFORMANCE_REPORT.UserListId

AUDIENCE_PERFORMANCE_REPORT.Id
UserList.id
Shopping Campaigns ServiceLink.serviceLinkId

ShoppingSetting.merchantId

SHOPPING_PERFORMANCE_REPORT.MerchantId

SHOPPING_PERFORMANCE_REPORT.AggregatorId
MerchantCenterLink.id

ShoppingSetting.merchant_id

segments.product_merchant_id

segments.product_aggregator_id
Conversion Action ConversionTracker.id

ConversionTrackerId (multiple reports)

ConversionTracker.originalConversionTypeId
ConversionAction.id
Account Conversion Tracking Configuration ConversionTrackingSettings.effectiveConversionTrackingId ConversionTrackingSetting.conversion_tracking_id

ConversionTrackingSetting. cross_account_conversion_tracking_id




Which IDs are affected in Google Ads scripts?
JavaScript can only accurately represent integers up to 53 bits, so it's strongly advised that you begin treating all IDs in Google Ads scripts as string to avoid any possible future errors with high ID numbers.
Google Ads scripts
Bidding Strategy AdsApp.BiddingStrategy.getId()
Budget AdsApp.BillingAccount.getId()

AdsApp.BudgetOrder.getId()
User List AdsApp.Audience.getId()

AdsApp.ExcludedAudience.getId()

AdsApp.UserList.getId()

AdsApp.​ShoppingCampaignAudience.getAudienceId()

AdsApp.ShoppingCampaignAudienceBuilder.withAudienceId()

AdsApp.ShoppingCampaignAudienceSelector.withIds()

getAudienceId() and withAudienceId() for all Targeting -> Audience Search methods.



Which IDs are affected in the Content API for Shopping?
All IDs are returned as string in REST and as INT64 in the client libraries. If you convert IDs to a number in your application, please make sure the application can handle 64-bit signed integers. An example of this is merchant ID that is set in the client library’s configuration or in the REST URL.
Content API for Shopping
Merchant Center AccountIdentifier.merchantId

Order.merchantId

OrdersCustomBatchRequestEntry.merchantId

RegionalinventoryCustomBatchRequestEntry.merchantId

ProductsCustomBatchRequestEntry.merchantId

ProductstatusesCustomBatchRequestEntry.merchantId

AccountsCustomBatchRequestEntry.merchantId

OrderReportDisbursement.merchantId

OrderReportTransaction.merchantId

LocalinventoryCustomBatchRequestEntry.merchantId

ReturnpolicyCustomBatchRequestEntry.merchantId
Shopping Campaign AccountIdentifier.aggregatorId



Where can I get support?
If you have any API questions or need help, you can reach us at:

Content API for Shopping live webinar on May 31st (Mandarin, Chinese)

We are running a live webinar this Friday, May 31, on the Content API for Shopping. This webinar is for our Chinese-speaking developers that are interested in using the API to manage products and Shopping ads at scale.

The webinar will cover topics on:
  • Content API for Shopping use case
  • Merchant Center setup
  • Content API features
  • Best practices
  • API request/response demo
You will be able to submit questions throughout the live event. We will answer questions during the Q&A session in the webinar.

Note: The webinar content will be delivered in Mandarin, Chinese.

The webinar will begin at 10:00am (China Time, GMT +8) on Friday, May 31, 2019. Please contact us via the Content API forum if you have any questions or need help.

If you’d like to review some of our previous webinars covering the Google Ads API, you can find them at the following links:

Announcing v2.1 of the Content API for Shopping

Today we're announcing the release of v2.1 of the Content API for Shopping. This version has been available as an experimental version since late last year and is now ready for production use by all Content API users.

Highlights
You can find a complete list of changes in the release notes and accompanying migration guide, but here are some highlights:
  • A more consistent product validation experience. Product insert requests no longer report non-fatal warnings or errors. This allows you to insert products and make subsequent updates to resolve issues via feed rules in the Merchant Center UI, just as you would with feeds maintained outside the API.
  • A better experience for managing Shopping Actions. Multiple improvements have been made to the Orders API based on feedback from beta users.
  • More features are on the way! Today's release contains many improvements, but more are on the way, including new ways to supply local inventory data and features to support supplemental feeds.
  • Continued v2 support. While we strongly encourage you to migrate to v2.1, support for v2 will continue at least through the first quarter of 2020. Subscribe to this blog to ensure you receive important updates on Content API releases and deprecations.
Updated client libraries
Updated client libraries with support for v2.1 are now available in multiple languages.

Learn more
Check out the v2.1 API reference documentation to explore the new version of the API, and read through the list of behavior changes and deprecations in the migration guide to help plan your upgrade to v2.1.

If you have any questions or need help with migration, please head over to our support forum.

Subscribe to our RSS feed to get blog posts via email

(If you want to continue getting email updates about our blog posts, read on. If you don't want email updates from this blog, you can skip this post.)

For some products, the Google Ads Developer team has used Google groups as a way to allow API users to subscribe and get new relevant blog posts delivered to their email address. Starting now, the way you can get email updates about blog posts is changing. We will no longer send an email to the Google group for each new blog post. We will continue to use the Google groups for other important updates, however.

For users who still want email updates, we've introduced new FeedBurner links on the right-hand panel of our blog homepage. You can subscribe to the RSS feed by clicking on the link for the product you're interested in, or subscribe by email by clicking on the [+] link to the right of the product name.

If you use any of the APIs that we discuss on this blog, make sure you subscribe to the feed to keep up with the latest news and updates:

Sunset of XML support in the Content API for Shopping

What's changing?
Starting September 1, 2019, the Content API for Shopping will no longer support requests or responses with XML payloads. All requests with an XML payload will fail after the sunset date.

Why is this change happening?
Version 2 of the Content API for Shopping changed the default request and response format from XML to JSON, and version 2.1 of the API (currently marked experimental) will not support XML. The majority of API requests now use JSON, so we've decided to sunset XML support and instead focus on enriching our JSON APIs with new features and functionality.

What should you do?
Prior to the sunset date, identify the components of your application that are using XML payloads for any of the following impacted services: For each case, modify your application to:
  • Send the request body as JSON.
  • Ensure you have removed the alt=xml parameter from the request.
  • Process the response as JSON.
  • Test your updated application using a separate test account.
Tip: The client libraries for .NET, Dart, Go, Java, JavaScript, Node.js, Objective-C, PHP, Python, and Ruby will send JSON requests and parse JSON responses for you. We strongly recommend that you use one of the libraries so you won't have to write marshalling and unmarshalling code in your application.

When converting a given request, you can use the JSON and XML tabs in the Request body section of the documentation for the method. For example, here's a partial screenshot of the XML tab for Inventory.set:

The corresponding JSON tab for that method is:

Compare the two tabs and use that as a guide when converting your request from XML to JSON.

You can find similar JSON and XML information for the response in one of the following locations:
  • Directly in the Response section for the method.
    Example: The productsCustomBatchResponse for Products.custombatch.
  • In the Resource representations section of the documentation for the resource returned in the response.
    Example: The products resource for Products.insert.
If you have any questions or feedback about this change, or any other questions about the Content API for Shopping, please let us know on the forum.