google.ads.googleads.v1.errors.GoogleAdsFailure The appropriate error code isn't part of the API yet.LOCATION operations CUSTOMER_FEED_ERROR_MISSING_FEEDMAPPING_FOR_PLACEHOLDER_TYPEfrom google.ads.google_ads.client import GoogleAdsClient
from google.ads.google_ads.v1.services.enums import FeedOriginEnum, PlaceholderTypeEnum
client = GoogleAdsClient(CREDENTIALS, DEV_TOKEN, login_customer_id=MANAGER_ID)
#
# Create Feed First
#
feed_service = client.get_service('FeedService', version='v1')
op = client.get_type('FeedOperation', version='v1')
feed = op.create
feed.name.value = f'GMB -- {GMB_AUTHED_EMAIL}'
feed.origin = FeedOriginEnum.FeedOrigin.GOOGLE
feed_data = feed.places_location_feed_data
feed_data.email_address.value = GMB_AUTHED_EMAIL
for label in LABELS:
l = feed_data.label_filters.add()
l.value = label
oauth = feed_data.oauth_info
oauth.http_method.value = 'PUT'
oauth.http_request_url.value = 'https://www.googleapis.com/auth/adwords'
oauth.http_authorization_header.value = f'Bearer {GMB_AUTHED_TOKEN}'
CLIENT_CUSTOMER_ID = '4317661474'
feed_results = feed_service.mutate_feeds(CLIENT_CUSTOMER_ID, [op])
feed = feed_results.results[0]
#
# Create CustomerFeed
#
cust_feed_service = client.get_service('CustomerFeedService', version='v1')
op = client.get_type('CustomerFeedOperation', version='v1')
cust_feed = op.create
cust_feed.feed.value = feed.resource_name
cust_feed.placeholder_types.append(PlaceholderTypeEnum.PlaceholderType.LOCATION)
matching = cust_feed.matching_function
matching.function_string.value = 'IDENTITY(true)'
# Failure here CUSTOMER_FEED_ERROR_MISSING_FEEDMAPPING_FOR_PLACEHOLDER_TYPE
resp = cust_feed_service.mutate_customer_feeds(CLIENT_CUSTOMER_ID, [op])
Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.
Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups "AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/908042a9-9a57-47e6-a669-305ba7217fc1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.