NEW Google Ads API Error creating Location Extension feed CUSTOMER_FEED_ERROR_MISSING_FEEDMAPPING_FOR_PLACEHOLDER_TYPE

113 views
Skip to first unread message

John Walker

unread,
May 3, 2019, 4:45:06 PM5/3/19
to AdWords API and Google Ads API Forum
Hello,

I'm am using new google-ads-python to sync GMB locations in order to create Google Ad Location Extensions.
I can not find any docs anywhere, not in code, the docs site or any blog posts on how to do Location Extensions in Google Ads API, only in Adwords API.
So I'm going off of that and trying to translate the code to the new python api. One of the issues is the FeedOrigin of ADWORDS does not exist in the new Google Ads API. But setting that to GOOGLE seems to work.

From a manager account, I can create a Feed in a client account, and the locations show up in the business feed area.
But the next call to create a CustomerFeed in that same client account fails. Below is the only error details I can pull out.

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_TYPE

Below is some of my python code. I have been spinning my wheels for 100+ hours now. Any help will be appreciated more than you know. Thank you.

from 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])


googleadsapi...@google.com

unread,
May 6, 2019, 2:55:07 AM5/6/19
to AdWords API and Google Ads API Forum
Hi John,

Thank you for reaching out to us. The CUSTOMER_FEED_ERROR_MISSING_FEEDMAPPING_FOR_PLACEHOLDER_TYPE occurs if the feed mapping for this placeholder type does not exist. I could see that you already created the a GMB feed. To further investigate this, could you provide the complete JSON request and response logs when you encountered the error? If you haven't enabled logging yet, you may do so by following this guide.

Regards,
Dave
Google Ads API Team


=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

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.

Take Survey

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.

John Walker

unread,
May 8, 2019, 11:53:39 AM5/8/19
to AdWords API and Google Ads API Forum
Hi Dave, thanks for the reply.

I figured it out. I had thought because the enums resolve to a number that i could just import and use the concrete enum classes that are in the python package.
This part cust_feed.placeholder_types.append(PlaceholderTypeEnum.PlaceholderType.LOCATION)

I'm not sure why but that was the cause. Changing to cust_feed.placeholder_types.append(client.get_type('PlaceholderTypeEnum', version='v1').LOCATION)

fixed it. Thanks again.
Reply all
Reply to author
Forward
0 new messages