Stay organized with collectionsSave and categorize content based on your preferences.
Merchant API supports multiple types of data sources and input methods to
provide product-related information in line with your business needs. Data
sources can contain different types of data:
product
inventory
promotion
review
You can configure data sources using multiple methods, including:
You can combine some data source types that are manageable through the Data
sources sub-API (for example products or promotions) with multiple supported
input methods (API, file upload, or file fetch). For example, a primary product
data source can be any of the following:
an API feed
a fetched file feed
an uploaded file feed
an Autofeed
This guide provides examples for managing data sources with various types of
data and input methods.
Special considerations
Take into account the following special considerations with some data source
types.
Read-only data sources: Some data source types are read-only through the
Data sources sub-API. That means you can list them and view their details,
but you cannot create, update, or delete them using this API. These include:
Data sources with products managed directly in the Merchant Center UI
(input typeUI).
Autofeeds (input typeAUTOFEED). While Autofeeds themselves are
read-only within the Data sources sub-API, you can enable or disable the
Autofeed feature for your account using theautofeedSettingsmethods in the Accounts sub-API. For more information, seeConfigure
Autofeed settingssection.
Feed rules: The Data sources sub-API primarily supports default feed
rules for linking supplemental data sources to primary data sources. Complex
custom rule creation and management are not supported directly within this
API. You can manage the order of supplemental data sources within the
default rule to specify in which order attributes from a primary source and
supplemental sources are combined.
Set up a local inventory data source with scheduled file fetching
You can create a local inventory data source that automatically fetches a file
from a specified URL on a schedule. To create a similar data source for regional
inventory, replace thelocalInventoryDataSourcefield withregionalInventoryDataSourcein the request body.
To create the data source, use thedataSources.createmethod and provide afileInputobject withfetchSettingsconfigured.
POST https://merchantapi.googleapis.com/datasources/v1/accounts/{ACCOUNT_ID}/dataSources
{"displayName":"My Scheduled Local Inventory Feed","localInventoryDataSource":{"feedLabel":"US_Stores","contentLanguage":"en"},"fileInput":{"fetchSettings":{"enabled":true,"timeOfDay":{"hours":23},"timeZone":"America/New_York","frequency":"FREQUENCY_DAILY","fetchUri":"https://www.example.com/inventory/local_inventory_feed.csv"}}}
A successful request returns the createdDataSourceresource.
{"name":"accounts/{ACCOUNT_ID}/dataSources/{DATASOURCE_ID}","dataSourceId":"{DATASOURCE_ID}","displayName":"My Scheduled Local Inventory Feed","localInventoryDataSource":{"feedLabel":"US_Stores","contentLanguage":"en"},"input":"FILE","fileInput":{"fetchSettings":{"enabled":true,"timeOfDay":{"hours":23},"timeZone":"America/New_York","frequency":"FREQUENCY_DAILY","fetchUri":"https://www.example.com/inventory/local_inventory_feed.csv"},"fileInputType":"FETCH"}}
The following code samples show how to create a local inventory data source with
scheduled fetching.
Java
importcom.google.api.gax.core.FixedCredentialsProvider;importcom.google.auth.oauth2.GoogleCredentials;importcom.google.shopping.merchant.datasources.v1.CreateDataSourceRequest;importcom.google.shopping.merchant.datasources.v1.DataSource;importcom.google.shopping.merchant.datasources.v1.DataSourcesServiceClient;importcom.google.shopping.merchant.datasources.v1.DataSourcesServiceSettings;importcom.google.shopping.merchant.datasources.v1.FileInput;importcom.google.shopping.merchant.datasources.v1.LocalInventoryDataSource;importshopping.merchant.samples.utils.Authenticator;importshopping.merchant.samples.utils.Config;/** This class demonstrates how to create a local inventory datasource */publicclassCreateFileLocalInventoryDataSourceSample{privatestaticStringgetParent(StringmerchantId){returnString.format("accounts/%s",merchantId);}privatestaticFileInputsetFileInput(){// If FetchSettings are not set, then this will be an `UPLOAD` file type// that you must manually upload via the Merchant Center UI.returnFileInput.newBuilder()// FileName is required for `UPLOAD` fileInput type..setFileName("British T-shirts Local Inventory Data").build();}publicstaticStringcreateDataSource(Configconfig,StringdisplayName,FileInputfileInput)throwsException{GoogleCredentialscredential=newAuthenticator().authenticate();DataSourcesServiceSettingsdataSourcesServiceSettings=DataSourcesServiceSettings.newBuilder().setCredentialsProvider(FixedCredentialsProvider.create(credential)).build();Stringparent=getParent(config.getAccountId().toString());// LocalInventoryDataSources can only be created for a specific `feedLabel` and// `contentLanguage` combination.LocalInventoryDataSourcelocalInventoryDataSource=LocalInventoryDataSource.newBuilder().setContentLanguage("en").setFeedLabel("GB").build();try(DataSourcesServiceClientdataSourcesServiceClient=DataSourcesServiceClient.create(dataSourcesServiceSettings)){CreateDataSourceRequestrequest=CreateDataSourceRequest.newBuilder().setParent(parent).setDataSource(DataSource.newBuilder().setDisplayName(displayName).setLocalInventoryDataSource(localInventoryDataSource).setFileInput(fileInput).build()).build();System.out.println("Sending Create Local Inventory DataSource request");DataSourceresponse=dataSourcesServiceClient.createDataSource(request);System.out.println("Inserted DataSource Name below");System.out.println(response.getName());returnresponse.getName();}catch(Exceptione){System.out.println(e);System.exit(1);returnnull;}}publicstaticvoidmain(String[]args)throwsException{Configconfig=Config.load();// The displayed datasource name in the Merchant Center UI.StringdisplayName="British Local Inventory File";// The file input data that this datasource will receive.FileInputfileInput=setFileInput();createDataSource(config,displayName,fileInput);}}
use Google\ApiCore\ApiException;use Google\Shopping\Merchant\DataSources\V1\Client\DataSourcesServiceClient;use Google\Shopping\Merchant\DataSources\V1\CreateDataSourceRequest;use Google\Shopping\Merchant\DataSources\V1\DataSource;use Google\Shopping\Merchant\DataSources\V1\FileInput;use Google\Shopping\Merchant\DataSources\V1\LocalInventoryDataSource;/*** This class demonstrates how to create a local inventory datasource with a* file input.*/class CreateFileLocalInventoryDataSourceSample{private static function getFileInput(): FileInput{// If FetchSettings is not set, then this will be an `UPLOAD` file type// that you must manually upload via the Merchant Center UI.return (new FileInput())// FileName is required for `UPLOAD` fileInput type.->setFileName('British T-shirts Local Inventory Data');}public function createDataSource(string $merchantId, string $displayName, FileInput $fileInput): void{// Gets the OAuth credentials to make the request.$credentials = Authentication::useServiceAccountOrTokenFile();// Creates options config containing credentials for the client to use.$options = ['credentials' => $credentials];// Creates a client.$dataSourcesServiceClient = new DataSourcesServiceClient($options);$parent = sprintf('accounts/%s', $merchantId);// LocalInventoryDataSources can only be created for a specific `feedLabel` and// `contentLanguage` combination.$localInventoryDataSource =(new LocalInventoryDataSource())->setContentLanguage('en')->setFeedLabel('GB');try {// Prepare the request message.$request = (new CreateDataSourceRequest())->setParent($parent)->setDataSource((new DataSource())->setDisplayName($displayName)->setLocalInventoryDataSource($localInventoryDataSource)->setFileInput($fileInput));print('Sending Create Local Inventory DataSource request' . PHP_EOL);$response = $dataSourcesServiceClient->createDataSource($request);print('Inserted DataSource Name below' . PHP_EOL);print($response->getName() . PHP_EOL);} catch (ApiException $ex) {printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());}}// Helper to execute the sample.function callSample(): void{$config = Config::generateConfig();// The Merchant Center Account ID.$merchantId = $config['accountId'];// The displayed datasource name in the Merchant Center UI.$displayName = 'British Primary Inventory File';$fileInput = self::getFileInput();$this->createDataSource($merchantId, $displayName, $fileInput);}}$sample = new CreateFileLocalInventoryDataSourceSample();$sample->callSample();
fromexamples.authenticationimportconfigurationfromexamples.authenticationimportgenerate_user_credentialsfromgoogle.shopping.merchant_datasources_v1importCreateDataSourceRequestfromgoogle.shopping.merchant_datasources_v1importDataSourcefromgoogle.shopping.merchant_datasources_v1importDataSourcesServiceClientfromgoogle.shopping.merchant_datasources_v1importFileInputfromgoogle.shopping.merchant_datasources_v1importLocalInventoryDataSource_ACCOUNT=configuration.Configuration().read_merchant_info()_PARENT=f"accounts/{_ACCOUNT}"defcreate_file_local_inventory_data_source():"""Creates a `DataSource` resource."""# Gets OAuth Credentials.credentials=generate_user_credentials.main()# Creates a client.client=DataSourcesServiceClient(credentials=credentials)# If FetchSettings are not set, then this will be an `UPLOAD` file type# that you must manually upload via the Merchant Center UI or via SFTP.file_input=FileInput()file_input.file_name="British T-shirts Local Inventory Data.txt"# Creates a SupplementalProductDataSource.local_inventory_datasource=LocalInventoryDataSource()# LocalInventoryDataSources can only be created for a specific# `feedLabel` and `contentLanguage` combination.local_inventory_datasource.content_language="en"local_inventory_datasource.feed_label="GB"# Creates a DataSource and populates its attributes.data_source=DataSource()data_source.display_name="Example Local Inventory DataSource"data_source.local_inventory_data_source=local_inventory_datasourcedata_source.file_input=file_input# Creates the request.request=CreateDataSourceRequest(parent=_PARENT,data_source=data_source)# Makes the request and catches and prints any error messages.try:response=client.create_data_source(request=request)print(f"DataSource successfully created:{response}")exceptRuntimeErrorase:print("DataSource creation failed")print(e)if__name__=="__main__":create_file_local_inventory_data_source()
curl -X POST \"https://merchantapi.googleapis.com/datasources/v1/accounts/{ACCOUNT_ID}/dataSources" \-H "Authorization: Bearer <API_TOKEN>" \-H "Content-Type: application/json" \-d '{"displayName": "My Scheduled Local Inventory Feed","localInventoryDataSource": {"feedLabel": "US_Stores","contentLanguage": "en"},"fileInput": {"fetchSettings": {"enabled": true,"timeOfDay": {"hours": 23},"timeZone": "America/New_York","frequency": "FREQUENCY_DAILY","fetchUri": "https://www.example.com/inventory/local_inventory_feed.csv"}}}'
Establish a promotion data source using the API
Promotion data sources let you submit promotional offers for your products. You
can create an API-based data source for your promotions, which lets you send
promotion data directly without needing to manage files.
POST https://merchantapi.googleapis.com/datasources/v1/accounts/{ACCOUNT_ID}/dataSources
{"displayName":"My API Promotions Source","promotionDataSource":{"targetCountry":"US","contentLanguage":"en"}}
A successful request returns the newly-createdDataSourceresource.
{"name":"accounts/{ACCOUNT_ID}/dataSources/{DATASOURCE_ID}","dataSourceId":"{DATASOURCE_ID}","displayName":"My API Promotions Source","promotionDataSource":{"targetCountry":"US","contentLanguage":"en"},"input":"API"}
The following code samples show how to create an API-based promotion data
source.
Java
importcom.google.api.gax.core.FixedCredentialsProvider;importcom.google.auth.oauth2.GoogleCredentials;importcom.google.shopping.merchant.datasources.v1.CreateDataSourceRequest;importcom.google.shopping.merchant.datasources.v1.DataSource;importcom.google.shopping.merchant.datasources.v1.DataSourcesServiceClient;importcom.google.shopping.merchant.datasources.v1.DataSourcesServiceSettings;importcom.google.shopping.merchant.datasources.v1.PromotionDataSource;importshopping.merchant.samples.utils.Authenticator;importshopping.merchant.samples.utils.Config;/** This class demonstrates how to create a promotion datasource. */publicclassCreatePromotionDataSourceSample{privatestaticStringgetParent(StringmerchantId){returnString.format("accounts/%s",merchantId);}publicstaticStringcreateDataSource(Configconfig,StringdisplayName)throwsException{GoogleCredentialscredential=newAuthenticator().authenticate();DataSourcesServiceSettingsdataSourcesServiceSettings=DataSourcesServiceSettings.newBuilder().setCredentialsProvider(FixedCredentialsProvider.create(credential)).build();Stringparent=getParent(config.getAccountId().toString());try(DataSourcesServiceClientdataSourcesServiceClient=DataSourcesServiceClient.create(dataSourcesServiceSettings)){CreateDataSourceRequestrequest=CreateDataSourceRequest.newBuilder().setParent(parent).setDataSource(DataSource.newBuilder().setDisplayName(displayName)// PromotionDataSources// can only be created for a specific `targetCountry` and `contentLanguage`// combination..setPromotionDataSource(PromotionDataSource.newBuilder().setContentLanguage("en").setTargetCountry("GB").build()).build()).build();System.out.println("Sending Create Promotion DataSource request");DataSourceresponse=dataSourcesServiceClient.createDataSource(request);System.out.println("Inserted DataSource Name below");System.out.println(response.getName());returnresponse.getName();}catch(Exceptione){System.out.println(e);System.exit(1);returnnull;}}publicstaticvoidmain(String[]args)throwsException{Configconfig=Config.load();// The displayed datasource name in the Merchant Center UI.StringdisplayName="British Promotions";createDataSource(config,displayName);}}
use Google\ApiCore\ApiException;use Google\Shopping\Merchant\DataSources\V1\Client\DataSourcesServiceClient;use Google\Shopping\Merchant\DataSources\V1\CreateDataSourceRequest;use Google\Shopping\Merchant\DataSources\V1\DataSource;use Google\Shopping\Merchant\DataSources\V1\PromotionDataSource;/*** This class demonstrates how to create a promotion datasource.*/class CreatePromotionDataSource{/*** Creates a new PromotionDataSource.** @param int $merchantId The Merchant Center account ID.* @param string $displayName The displayed datasource name in the Merchant Center UI.* @return string The name of the newly created PromotionDataSource.*/function createPromotionDataSourceSample(int $merchantId, string $displayName): string{// Gets the OAuth credentials to make the request.$credentials = Authentication::useServiceAccountOrTokenFile();// Creates options config containing credentials for the client to use.$options = ['credentials' => $credentials];// Creates a client.$dataSourcesServiceClient = new DataSourcesServiceClient($options);$parent = sprintf('accounts/%s', $merchantId);// Creates the data source.$dataSource = (new DataSource())->setDisplayName($displayName)->setPromotionDataSource((new PromotionDataSource())->setContentLanguage('en')->setTargetCountry('GB'));// Creates the request.$request = (new CreateDataSourceRequest())->setParent($parent)->setDataSource($dataSource);// Sends the request to the API.try {print('Sending Create Promotion DataSource request' . PHP_EOL);$response = $dataSourcesServiceClient->createDataSource($request);print('Inserted DataSource Name below' . PHP_EOL);print($response->getName() . PHP_EOL);return $response->getName();} catch (ApiException $ex) {printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());return '';}}// Helper to execute the sample.public function callSample(): void{$config = Config::generateConfig();// The Merchant Center Account ID.$merchantId = $config['accountId'];// The displayed datasource name in the Merchant Center UI.$displayName = 'British Promotions';$this->createPromotionDataSourceSample($merchantId, $displayName);}}$sample = new CreatePromotionDataSource();$sample->callSample();
fromexamples.authenticationimportconfigurationfromexamples.authenticationimportgenerate_user_credentialsfromgoogle.shoppingimportmerchant_datasources_v1_ACCOUNT=configuration.Configuration().read_merchant_info()_PARENT=f"accounts/{_ACCOUNT}"defcreate_promotion_data_source():"""Creates a `DataSource` resource."""# Gets OAuth Credentials.credentials=generate_user_credentials.main()# Creates a client.client=merchant_datasources_v1.DataSourcesServiceClient(credentials=credentials)# Creates a PromotionDataSource.# PromotionDataSources# can only be created for a specific `targetCountry` and `contentLanguage`# combination.promotion_datasource=merchant_datasources_v1.PromotionDataSource()promotion_datasource.target_country="CH"promotion_datasource.content_language="fr"# Creates a DataSource and populates its attributes.data_source=merchant_datasources_v1.DataSource()data_source.display_name="Example DataSource"data_source.promotion_data_source=promotion_datasource# Creates the request.request=merchant_datasources_v1.CreateDataSourceRequest(parent=_PARENT,data_source=data_source)# Makes the request and catches and prints any error messages.try:response=client.create_data_source(request=request)print(f"DataSource successfully created:{response}")exceptRuntimeErrorase:print("DataSource creation failed")print(e)if__name__=="__main__":create_promotion_data_source()
curl -X POST \"https://merchantapi.googleapis.com/datasources/v1/accounts/{ACCOUNT_ID}/dataSources" \-H "Authorization: Bearer <API_TOKEN>" \-H "Content-Type: application/json" \-d '{"displayName": "My API Promotions Source","promotionDataSource": {"targetCountry": "US","contentLanguage": "en"}}'
Create a product review data source for file uploads
Use product review data sources to submit customer reviews for your products.
You can configure a data source to accept manually-uploaded files for product
reviews.
Use thedataSources.createmethod, specifyproductReviewDataSource, and include afileInputwith a
designatedfileName.
POST https://merchantapi.googleapis.com/datasources/v1/accounts/{ACCOUNT_ID}/dataSources
To create a data source for merchant reviews, you can use a similar request,
replacing theproductReviewDataSourceobject with an emptymerchantReviewDataSourceobject.
The following code samples show how to create a product review data source for
manual file uploads.
Java
importcom.google.api.gax.core.FixedCredentialsProvider;importcom.google.auth.oauth2.GoogleCredentials;importcom.google.shopping.merchant.datasources.v1.CreateDataSourceRequest;importcom.google.shopping.merchant.datasources.v1.DataSource;importcom.google.shopping.merchant.datasources.v1.DataSourcesServiceClient;importcom.google.shopping.merchant.datasources.v1.DataSourcesServiceSettings;importcom.google.shopping.merchant.datasources.v1.ProductReviewDataSource;importjava.io.IOException;importshopping.merchant.samples.utils.Authenticator;importshopping.merchant.samples.utils.Config;/** This class demonstrates how to create a product review data source. */publicclassCreateProductReviewsDataSourceSample{privatestaticvoidcreateProductReviewsDataSource(StringaccountId)throwsIOException{GoogleCredentialscredential=newAuthenticator().authenticate();DataSourcesServiceSettingsdataSourcesServiceSettings=DataSourcesServiceSettings.newBuilder().setCredentialsProvider(FixedCredentialsProvider.create(credential)).build();try(DataSourcesServiceClientdataSourcesServiceClient=DataSourcesServiceClient.create(dataSourcesServiceSettings)){CreateDataSourceRequestrequest=CreateDataSourceRequest.newBuilder().setParent(String.format("accounts/%s",accountId)).setDataSource(DataSource.newBuilder().setDisplayName("Product Reviews Data Source").setProductReviewDataSource(ProductReviewDataSource.newBuilder().build()).build()).build();System.out.println("Creating product reviews data source...");DataSourcedataSource=dataSourcesServiceClient.createDataSource(request);System.out.println(String.format("Datasource created successfully: %s",dataSource.getName()));}catch(Exceptione){System.out.println(e);System.exit(1);}}publicstaticvoidmain(String[]args)throwsException{Configconfig=Config.load();createProductReviewsDataSource(config.getAccountId().toString());}}
Automated data sourcesautomatically create product data based on your website's content. While the
Autofeed data source itself is read-only within the Data sources sub-API, you
can enable or disable the Autofeed feature for your account using theautofeedSettings.updateAutofeedSettingsmethod in the Accounts sub-API.
This example enables product crawling through Autofeed for the account.
The following code samples show how to enable Autofeed settings for an account.
Java
importcom.google.api.gax.core.FixedCredentialsProvider;importcom.google.auth.oauth2.GoogleCredentials;importcom.google.protobuf.FieldMask;importcom.google.shopping.merchant.accounts.v1.AutofeedSettings;importcom.google.shopping.merchant.accounts.v1.AutofeedSettingsName;importcom.google.shopping.merchant.accounts.v1.AutofeedSettingsServiceClient;importcom.google.shopping.merchant.accounts.v1.AutofeedSettingsServiceSettings;importcom.google.shopping.merchant.accounts.v1.UpdateAutofeedSettingsRequest;importshopping.merchant.samples.utils.Authenticator;importshopping.merchant.samples.utils.Config;/** This class demonstrates how to update AutofeedSettings to be enabled. */publicclassUpdateAutofeedSettingsSample{publicstaticvoidupdateAutofeedSettings(Configconfig)throwsException{GoogleCredentialscredential=newAuthenticator().authenticate();AutofeedSettingsServiceSettingsautofeedSettingsServiceSettings=AutofeedSettingsServiceSettings.newBuilder().setCredentialsProvider(FixedCredentialsProvider.create(credential)).build();// Creates AutofeedSettings name to identify AutofeedSettings.Stringname=AutofeedSettingsName.newBuilder().setAccount(config.getAccountId().toString()).build().toString();// Create AutofeedSettings with the updated fields.AutofeedSettingsautofeedSettings=AutofeedSettings.newBuilder().setName(name).build();FieldMaskfieldMask=FieldMask.newBuilder().addPaths("*").build();try(AutofeedSettingsServiceClientautofeedSettingsServiceClient=AutofeedSettingsServiceClient.create(autofeedSettingsServiceSettings)){UpdateAutofeedSettingsRequestrequest=UpdateAutofeedSettingsRequest.newBuilder().setAutofeedSettings(autofeedSettings).setUpdateMask(fieldMask).build();System.out.println("Sending Update AutofeedSettings request");AutofeedSettingsresponse=autofeedSettingsServiceClient.updateAutofeedSettings(request);System.out.println("Updated AutofeedSettings Name below");System.out.println(response.getName());}catch(Exceptione){System.out.println(e);}}publicstaticvoidmain(String[]args)throwsException{Configconfig=Config.load();updateAutofeedSettings(config);}}
use Google\ApiCore\ApiException;use Google\Protobuf\FieldMask;use Google\Shopping\Merchant\Accounts\V1\AutofeedSettings;use Google\Shopping\Merchant\Accounts\V1\Client\AutofeedSettingsServiceClient;use Google\Shopping\Merchant\Accounts\V1\UpdateAutofeedSettingsRequest;/*** This class demonstrates how to update AutofeedSettings to be enabled.*/class UpdateAutofeedSettingsSample{/*** Update AutofeedSettings to be enabled.** @param array $config The configuration data for authentication and account ID.* @return void*/public static function updateAutofeedSettingsSample(array $config): void{// Get OAuth credentials.$credentials = Authentication::useServiceAccountOrTokenFile();// Create options for the client.$options = ['credentials' => $credentials];// Create a client.$autofeedSettingsServiceClient = new AutofeedSettingsServiceClient($options);// Create the AutofeedSettings name.$name = "accounts/" . $config['accountId'] . "/autofeedSettings";// Create AutofeedSettings object.$autofeedSettings = (new AutofeedSettings())->setName($name);// Create FieldMask.$fieldMask = (new FieldMask())->setPaths(["*"]);// Call the API.try {// Prepare the request.$request = (new UpdateAutofeedSettingsRequest())->setAutofeedSettings($autofeedSettings)->setUpdateMask($fieldMask);print "Sending Update AutofeedSettings request\n";$response = $autofeedSettingsServiceClient->updateAutofeedSettings($request);print "Updated AutofeedSettings Name below\n";print $response->getName() . "\n";} catch (ApiException $e) {print $e->getMessage();}}/*** Helper to execute the sample.** @return void*/public function callSample(): void{$config = Config::generateConfig();self::updateAutofeedSettingsSample($config);}}// Run the script$sample = new UpdateAutofeedSettingsSample();$sample->callSample();
fromexamples.authenticationimportconfigurationfromexamples.authenticationimportgenerate_user_credentialsfromgoogle.protobufimportfield_mask_pb2fromgoogle.shopping.merchant_accounts_v1importAutofeedSettingsfromgoogle.shopping.merchant_accounts_v1importAutofeedSettingsServiceClientfromgoogle.shopping.merchant_accounts_v1importUpdateAutofeedSettingsRequest_ACCOUNT=configuration.Configuration().read_merchant_info()defupdate_autofeed_settings():"""Updates the AutofeedSettings of a Merchant Center account."""# Gets OAuth Credentials.credentials=generate_user_credentials.main()# Creates a client.client=AutofeedSettingsServiceClient(credentials=credentials)# Creates name to identify the AutofeedSettings.name="accounts/"+_ACCOUNT+"/autofeedSettings"# Create AutofeedSettings with the updated fields.autofeed_settings=AutofeedSettings(name=name,enable_products=False)# Create the field mask.field_mask=field_mask_pb2.FieldMask(paths=["enable_products"])# Creates the request.request=UpdateAutofeedSettingsRequest(autofeed_settings=autofeed_settings,update_mask=field_mask)# Makes the request and catches and prints any error messages.try:response=client.update_autofeed_settings(request=request)print("Updated AutofeedSettings Name below")print(response.name)exceptRuntimeErrorase:print("Update AutofeedSettings request failed")print(e)if__name__=="__main__":update_autofeed_settings()
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[],[],null,[]]