Hello,
When I try to create a location sync asset set, I get the following error,
ErrorCode: “{{ “fieldError”: “VALUE_MUST_BE_UNSET” }}’
Location: {{ “fieldPathElements”: [ { “fieldName”: “operations”, “index”: 0 }, { “fieldName”: “create” }, { “fieldName”: “location_set” } ] }}
Your guide clearly states that the location set field on the AssetSet entity needs to be set. (https://developers.google.com/google-ads/api/docs/assets/location-assets#create-location-sync)
Can you give me some guidance? Here's my code.
BusinessProfileLocationSet businessProfileLocationSet = new BusinessProfileLocationSet { HttpAuthorizationToken = await GetBusinessProfileAccessToken(), EmailAddress = BusinessProfileEmailAddress, BusinessAccountId = BusinessAccountId, }; businessProfileLocationSet.LabelFilters.Add("SomeLabelFilter"); AssetSet assetSet = new AssetSet { Type = AssetSetType.LocationSync, LocationSet = new LocationSet { LocationOwnershipType = LocationOwnershipType.Affiliate, BusinessProfileLocationSet = businessProfileLocationSet }, Name = "LocationAsset", }; GoogleAdsClient client = Authenticator.CreateGoogleAdsClientForTestAccount(); AssetSetServiceClient assetSetService = client.GetService(Services.V15.AssetSetService); MutateAssetSetsResponse mutateAssetSetsResponse = await assetSetService.MutateAssetSetsAsync(CustomerId.ToString(), new AssetSetOperation[] { new() { Create = assetSet } });![]() |
Google Ads API Team |