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


-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@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+unsubscr...@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.
  • NEW Goo... John Walker
    • RE... googleadsapi-forumadvisor via AdWords API and Google Ads API Forum
      • ... John Walker

Reply via email to