Import "google.ads.googleads.enums.types" could not be resolved

238 views
Skip to first unread message

Li Tom

unread,
Aug 27, 2024, 4:34:52 AM8/27/24
to Google Ads API and AdWords API Forum

Hello! I've created a Python program to create a new Google Ads account under an MCC account, but I'm having trouble setting the default serving country from the start. I want to set the country to the United Kingdom with the currency in USD. However, the program keeps creating accounts with the default country as the USA and the currency as USD. When I import the following module to specify the country, I get an error in VS Code:

import sys
from datetime import datetime
from google.ads.googleads.client import GoogleAdsClient
from google.ads.googleads.errors import GoogleAdsException
from google.ads.googleads.enums.types import ServingCountryEnum

The error is: Import "google.ads.googleads.enums.types" could not be resolved.

How can I solve this problem?

Google Ads API Forum Advisor

unread,
Aug 27, 2024, 9:04:27 AM8/27/24
to lieng...@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for reaching out to the Google Ads API support team.

To create an account under an MCC account, I would recommend you refer to this guide on "creating an account". This also has a code example demonstrating customer creation. Follow the example and let us know how it goes. Please verify the currency code and time zone at the time of creation.

If you still think that you are doing it the right way but the program keeps creating accounts with the default country as the USA and the currency as USD, kindly provide us with the complete API logs (request and response with request-id and request header) generated at your end to assist you further.

If you are using the Python client library and haven't enabled the logging yet, I would request you to enable it by referring to this guide on Logging. For REST interface requests, you can enable logging via the curl command by using the -i flag.

You can send the details via Reply privately to the author option, or direct private reply to this email.

 
This message is in relation to case "ref:!00D1U01174p.!5004Q02vFQjb:ref" (ADR-00265042)

Thanks,
 
Google Logo Google Ads API Team


Li Tom

unread,
Aug 27, 2024, 12:29:52 PM8/27/24
to Google Ads API and AdWords API Forum

Hello,

Thank you for your guidance on creating an account under an MCC account.

I have followed the steps in the guide and ensured that logging is enabled in my Python script. However, I am encountering an issue where, despite specifying the desired currency and time zone, the account is created with the default country set to the USA.

Here are the details of the issue:

  • Desired Currency: GBP
  • Desired Time Zone: Europe
  • Desired Default Country: United Kingdom (UK)

Logs from the Recent API Request:

INFO:google.ads.googleads.client:Request made: ClientCustomerId: 5686622991, Host: googleads.googleapis.com, Method: /google.ads.googleads.v17.services.CustomerService/CreateCustomerClient, RequestId: 5dnVQ1UbITM1Oo8hCK3gTA, IsFault: False, FaultMessage: None
Customer created with resource name "customers/3709677698" under manager account with ID "5686622991".

Issue Encountered:

  • The created account correctly reflects the specified currency and time zone.
  • However, the default country for the account is set to the USA, which does not match the desired settings.

I am looking to set the default country to match the selected time zone and currency (United Kingdom in this case), but it seems to default to the USA. Could you please assist me in resolving this issue or provide guidance on how to correctly set the default country according to the time zone and currency specified?

Thank you for your assistance.

Best regards,

Li Tom


Vào lúc 20:04:27 UTC+7 ngày Thứ Ba, 27 tháng 8, 2024, Google Ads API Forum Advisor đã viết:

Google Ads API Forum Advisor

unread,
Aug 28, 2024, 1:30:45 AM8/28/24
to lieng...@gmail.com, adwor...@googlegroups.com
Hi,

From the provide logs, I could see you have not provided the complete request of CreateCustomerClientRequest resource, kindly provide us with the complete API logs (request) generated at your end so that we can better assist you.
Reply all
Reply to author
Forward
0 new messages