Lead Form Asset Creation Query

95 views
Skip to first unread message

Rajat Singh

unread,
Jul 11, 2025, 3:49:04 AMJul 11
to Google Ads API and AdWords API Forum
Hi,

I'm working with the Google Ads API v18 to create `LeadFormAsset` objects that include **predefined qualifying questions** (like "What is your budget?", "What service are you interested in?", etc.).

I've found the following enums:

* `LeadFormFieldQuestionEnum`
* `LeadFormFieldQuestionCategoryEnum`

However, these enums only provide **enum names** (e.g. `INDUSTRY`, `BUDGET`, `AUTO`) but not:

1. The actual **display text** of the questions
2. The list of predefined **answer options** associated with each question

I'd like to know:

* Is there a way to retrieve the **full list of supported predefined lead form questions** along with their **default answer choices** via the API?
* If not available via API, is there a **maintained reference or dataset** (e.g. in documentation or JSON file) where this mapping is available?
* Does any service like `AssetFieldTypeViewService` or metadata endpoints expose this information?

I'm building a dynamic form builder and want to provide users with all valid question/answer options that Google Ads supports.

Any help would be greatly appreciated!

Google Ads API Forum Advisor

unread,
Jul 11, 2025, 9:44:54 AMJul 11
to rajat.sing...@gmail.com, adwor...@googlegroups.com

Hi,

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

By reviewing your query, I understand that you want to retrieve the lead form questions along with the answers through the Google Ads API. I would recommend you to use the field ‘asset.lead_form_asset.custom_question_fields’ from lead_form_submission_data resource to  retrieve the ordered list of custom question fields. This field is subject to a limit of 5 qualifying questions per form. However I’m providing the below GAQL query:

SELECT asset.lead_form_asset.custom_question_fields FROM lead_form_submission_data

You can use the search or searchStream methods in making the API calls while retrieving the data. Additionally, you can utilize the Google Ads Query Builder and Query Validator to build and validate the queries for retrieving the data from the Google Ads API.

Also, note that asset_field_type_view service is available in Google Ads API. This report is used to retrieve the non-overcounted metrics for each asset field type when the asset is used as extension. I would recommend you to refer to this documentation to know which metrics and segments are supported for this resource.

I could see that you are using the  'v18' version to create lead form assets. Please note that the v18 is already deprecated and is about to sunset in August 2025. After this date, all v18 API requests will begin to fail. I would suggest you upgrade to the latest version, 'v20', as soon as possible to benefit from new features. You may refer to this documentation on deprecation and sunset for more information regarding the specific deprecation and sunset dates for each available version.

To assist you further, could you please provide us with the uncropped UI screenshot of the fields that you are trying to retrieve through the Google Ads API by displaying the Google Ads customer ID so that we can investigate your issue further.

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

Thanks,
 
Google Logo Google Ads API Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5
[2025-07-11 13:44:10Z GMT] This message is in relation to case "ref:!00D1U01174p.!500Ht01svNXa:ref" (ADR-00318348)



Rajat Singh

unread,
Jul 14, 2025, 2:51:06 AMJul 14
to Google Ads API and AdWords API Forum

Thank You for the clarification.
I’m currently working on an integration using the Google Ads API v20 to programmatically create lead form assets for our campaigns. One key feature we’re trying to support is the use of qualifying questions — such as “Are you over 18?” or questions specific to industry verticals like automotive, education, or financial services.

In the Google Ads UI, these predefined questions appear based on selected categories, and allow advertisers to collect structured lead information. However, in the API, I've encountered the following limitations:

---

### 🛑 Issues Observed:

* The `LeadFormCustomQuestionField` and `LeadFormSingleChoiceQuestion` types appear unavailable in v20 or result in errors like:

  ```
  not_allowlisted_error: CUSTOMER_NOT_ALLOWLISTED_FOR_THIS_FEATURE
  ```
* Attempting to set qualifying questions via the API results in warnings or silent failures.
* There is no documented API method for retrieving the available question categories or questions by category (e.g., Auto, Insurance, Education).

---

### 🙋‍♀️ Questions:

1. Does API v20 support adding qualifying questions to lead form assets, similar to what’s available in the UI?
2. If this feature is restricted, is there a process to request allowlist access for our customer account(s)?
3. Is there a recommended way to programmatically retrieve qualifying question categories and their associated predefined questions?
4. Can these categories and question sets be dynamically queried via the API, or do we need to maintain our own mapping?
5. Is support for qualifying/custom questions planned in future API versions, and if so, is there a timeline?

We are aiming to build a seamless form generation tool that aligns with the UI's full feature set, while maintaining compliance with Google’s lead collection policies.

Your assistance and clarification would be greatly appreciated.

Google Ads API Forum Advisor

unread,
Jul 14, 2025, 8:26:52 AMJul 14
to rajat.sing...@gmail.com, adwor...@googlegroups.com
Hi,

From the provided information, you are encountering the CUSTOMER_NOT_ALLOWLISTED_FOR_THIS_FEATURE error. In order to assist you further, please provide the complete API logs (request and response with request-id and request header) generated at your end.

If you are using a client library and haven't enabled the logging yet, I would request you to enable logging for the specific client library that you are using. You can refer to the guides Java.NetPHPPythonRuby or Perl to enable logging at your end. For REST interface requests, you can enable logging via the curl command by using the -i flag.

Kindly note that creating a new custom question field which is not yet supported to retrieve via the Google Ads API. However, Iam raising a request for this feature to be available in the Google Ads API. I cannot provide a scheduled timeline for the availability of this feature in the API. I would recommend you to please follow our Release Notes and Blog post for future updates.​ ​ ​

In order to assist further, can you confirm whether your requirement ( qualifying question categories and their associated predefined questions) is possible to do from the Google Ads UI? If yes, I would request you to provide an uncropped UI screenshot of the Google Ads account (with visible customer ID) by highlighting the fields which you want to retrieve through the Google Ads API, so that we can check whether the same feature is available in the API.

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


Thanks,
 
Google Logo Google Ads API Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5

[2025-07-14 12:26:10Z GMT] This message is in relation to case "ref:!00D1U01174p.!500Ht01svNXa:ref" (ADR-00318348)



Rajat Singh

unread,
Jul 14, 2025, 8:36:17 AMJul 14
to Google Ads API and AdWords API Forum
Thank you for the clarification. I was referring to the fields shown in the screenshot.
I am using Python and I want to fetch this data properly with the help of the helper API. Then, I will use this data to send the selected question to the Google Ads lead form for creating a lead form asset. I need your help with this—please let me know how I can do it.
Thanks
Screenshot from 2025-07-14 18-02-41.png
Screenshot from 2025-07-14 18-02-27.png

Google Ads API Forum Advisor

unread,
Jul 14, 2025, 10:43:07 AMJul 14
to rajat.sing...@gmail.com, adwor...@googlegroups.com

Hi,

Kindly note that it’s not possible to retrieve the predefined qualifying questions along with their answers through the Google Ads API. However, it’s possible to retrieve the already created lead form questions along with the answers through the Google Ads API. I would recommend you to use the asset.lead_form_asset.custom_question_fields from asset resource. However, I’m providing the below GAQL query:

SELECT asset.lead_form_asset.custom_question_fields FROM asset

You can use the search or searchStream methods in making the API calls while retrieving the data. Additionally, you can utilize the Google Ads Query Builder and Query Validator to build and validate the queries for retrieving the data from the Google Ads API. 

Thanks,

 
Google Logo Google Ads API Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5

[2025-07-14 14:42:06Z GMT] This message is in relation to case "ref:!00D1U01174p.!500Ht01svNXa:ref" (ADR-00318348)



Rajat Singh

unread,
Jul 15, 2025, 4:43:16 AMJul 15
to Google Ads API and AdWords API Forum

I am using the following import in my code:

from google.ads.googleads.v20.common.types.asset_types import ( LeadFormCustomQuestionField, LeadFormSingleChoiceAnswers, )

And here's the logic I'm using to add custom questions to a lead form:

for question in form_config.get("custom_questions", []):
    try:
        # Create the question object
        custom_question = client.get_type("LeadFormCustomQuestionField")
        custom_question.question_text = question["question_text"]

        if question.get("field_type") == "MULTIPLE_CHOICE":
            # Create SingleChoiceAnswers
            sc_answers = client.get_type("LeadFormSingleChoiceAnswers")
            sc_answers.answers.extend(question.get("answer_options", []))

            # Attach to the question object
            custom_question.single_choice_answers.CopyFrom(sc_answers)

        # Append the question to the lead form
        lead_form.custom_question_fields.append(custom_question)

    except Exception as e:
        logging.warning(f"⚠️ Skipping custom question due to error: {e}")

However, I am getting the following error:

WARNING:root:⚠️ Skipping custom question due to error: Unknown field for LeadFormCustomQuestionField: question_text

It seems like question_text is not a valid field in LeadFormCustomQuestionField in version v20. Could you please confirm what field should be used to define the question text? I'm trying to create a Lead Form Asset using my own API, and I'm currently unable to send custom questions properly to Google Ads.

Also, the query you provided earlier doesn't return the list of custom questions either. Please help me resolve this.


Thank You

Google Ads API Forum Advisor

unread,
Jul 15, 2025, 7:34:50 AMJul 15
to rajat.sing...@gmail.com, adwor...@googlegroups.com

Hi,

By reviewing your query, I understand that you are getting the error while adding a custom questions to a lead form asset through the Google Ads API. I would recommend you to add the custom_question_text field to a LeadFormCustomQuestionField through the assets.mutate operation through the Google Ads API to create the custom questions. Kindly note that the custom_question_text  field is a string that contains the exact custom question field text (for example, "What kind of vehicle do you have?"). I would suggest you refer to the Add Lead Form Asset code example for creating the custom questions fields to lead form asset through the Google Ads API. 

Also, you have mentioned that the query doesn’t return the list of custom questions. To investigate your issue further, please provide us with the complete API logs (request and response with request-id and request header) generated at your end.

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

Thanks,

 
Google Logo Google Ads API Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5

[2025-07-15 11:33:48Z GMT] This message is in relation to case "ref:!00D1U01174p.!500Ht01svNXa:ref" (ADR-00318348)



Rajat Singh

unread,
Jul 17, 2025, 12:46:29 AMJul 17
to Google Ads API and AdWords API Forum

Help Needed with Custom Questions in Lead Form Asset Creation (Google Ads API)

Hello,

I’m currently working on creating a lead form asset using the Google Ads API. However, I'm encountering an issue when trying to add custom questions based on categories such as "Auto", "Business", etc.

Here’s the implementation I’m using for custom questions:

# Custom Questions
# for question in form_config.get("custom_questions", []):
# try:
# question_text = question.get("question_text", "").strip()
# if not (1 <= len(question_text) <= 100):
# logging.warning(f"Skipping question due to invalid text length: '{question_text}'")
# continue
#
# custom_question = client.get_type("LeadFormCustomQuestionField")()
# custom_question.custom_question_text = question_text
#
# if question.get("field_type") == "MULTIPLE_CHOICE":
# options = question.get("answer_options", [])
# valid_options = [opt.strip() for opt in options if isinstance(opt, str) and opt.strip()]
# if not (2 <= len(valid_options) <= 12):
# logging.warning(f"MULTIPLE_CHOICE must have 2–12 options, skipping: {valid_options}")
# continue
# custom_question.single_choice_answers.answers.extend(valid_options)
#
# lead_form.custom_question_fields.append(custom_question)
# except Exception as e:
# logging.warning(f"Skipping custom question: {e}")

Even though I’m using API version v20, I still receive an error related to LeadFormCustomQuestionField.

Could you please help me understand what the issue might be? Also, could you guide me on the correct way to send custom questions to Google through the API?

Looking forward to your help.

Thank you,
Rajat Singh

Google Ads API Forum Advisor

unread,
Jul 17, 2025, 3:58:20 AMJul 17
to rajat.sing...@gmail.com, adwor...@googlegroups.com
Hi Rajat,

Based on the provided information, I understand that you are encountering an error while adding custom questions to create a lead form asset using the Google Ads API. Could you please confirm whether you have followed the earlier suggested documents on adding a custom_question_text field to a LeadFormCustomQuestionField through the assets.mutate? Also, kindly go through the sample example on adding a lead form asset via the API. Please be informed that I have tried to create a lead form asset at my end and I'm able to do it successfully without any errors. I would suggest you kindly follow the below given sample request and response logs for your reference.

Request:

{
  "operations": [
    {
      "create": {
        "leadFormAsset": {
          "businessName": "Interplanetary Cruise",
          "callToActionType": "BOOK_NOW",
          "callToActionDescription": "Latest trip to Jupiter!",
          "headline": "Trip to Jupiter",
          "description": "Our latest trip to Jupiter is now open for booking.",
          "privacyPolicyUrl": "http://example.com/privacy",
          "fields": [
            {
              "inputType": "FULL_NAME"
            },
            {
              "inputType": "EMAIL"
            },
            {
              "inputType": "PHONE_NUMBER"
            }
          ],
          "customQuestionFields": [
            {
              "singleChoiceAnswers": {
                "answers": [
                  "Before 9AM",
                  "Anytime",
                  "After sometime"
                ]
              }
            }
          ]
        }
      }
    }
  ]
}


Response:

customers/customer_Id/assets/asset_Id
If you still encounter any errors even after following the given suggestions, I request you kindly share the updated complete API logs (request and response with request-id and request header) generated at your end while adding custom questions to lead form asset or at least share the request-id that is generated while making the API calls.

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


Thanks,
 
Google Logo Google Ads API Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5

[2025-07-17 07:57:39Z GMT] This message is in relation to case "ref:!00D1U01174p.!500Ht01svNXa:ref" (ADR-00318348)



Rajat Singh

unread,
Jul 17, 2025, 6:35:02 AMJul 17
to Google Ads API and AdWords API Forum
Errorr Resposne  I am getting:
WARNING:root:⚠️ Error in qualifying question '{'question': 'VEHICLE_TYPE', 'answer': ['SUV', 'Sedan']}': Specified type 'LeadFormQuestionFieldInfo' does not exist in Google Ads API v20
WARNING:root:⚠️ Error in qualifying question '{'question': 'What kind of car do you currently drive?', 'answer': ['Toyota', 'Honda', 'Other']}': 'LeadFormCustomQuestionField' object is not callable

payload:
"qualifying_questions": [
{
"question": "VEHICLE_TYPE",
"answer": [
"SUV",
"Sedan"
]
},
{
"question": "What kind of car do you currently drive?",
"answer": [
"Toyota",
"Honda",
"Other"
]
}
], my current code
standard_qualifying_question_enum = client.enums.LeadFormFieldUserInputTypeEnum
standard_question_values = {q["value"] for q in QUALIFYING_QUESTION_ENUMS}

for q in form_config.get("qualifying_questions", []):
try:
if q["question"] in standard_question_values:
# Predefined question
question_field = client.get_type("LeadFormQuestionFieldInfo")()
question_field.question_field = standard_qualifying_question_enum[q["question"]]

if isinstance(q["answer"], list):
question_field.answer_choice.extend(q["answer"])
else:
question_field.answer_choice.append(q["answer"])

lead_form.qualifying_question_fields.append(question_field)
else:
# Custom question
custom_question = client.get_type("LeadFormCustomQuestionField")()
custom_question.custom_question_text = q["question"]

if isinstance(q["answer"], list) and len(q["answer"]) >= 2:
choice_answers = client.get_type("LeadFormSingleChoiceAnswers")()
choice_answers.answers.extend(q["answer"])
custom_question.single_choice_answers = choice_answers


lead_form.custom_question_fields.append(custom_question)
except Exception as e:
logging.warning(f"⚠️ Error in qualifying question '{q}': {e}")

Rajat Singh

unread,
Jul 17, 2025, 6:45:37 AMJul 17
to Google Ads API and AdWords API Forum
I also tried this but stil gettin error
WARNING:root:⚠️ Error in qualifying question '{'question': 'VEHICLE_TYPE', 'answer': ['SUV', 'Sedan']}': 'LeadFormField' object is not callable

WARNING:root:⚠️ Error in qualifying question '{'question': 'What kind of car do you currently drive?', 'answer': ['Toyota', 'Honda', 'Other']}': 'LeadFormCustomQuestionField' object is not callable

# Qualifying Questions (Standard Enums: VEHICLE_TYPE, JOB_ROLE, etc.)
standard_qualifying_question_enum = client.enums.LeadFormFieldUserInputTypeEnum
standard_question_values = {q["value"] for q in QUALIFYING_QUESTION_ENUMS}

for q in form_config.get("qualifying_questions", []):
try:
# Handle standard (enum-based) qualifying questions
if q["question"] in standard_question_values:
question_field = client.get_type("LeadFormField", version="v20")()
question_field.input_type = standard_qualifying_question_enum[q["question"]]

# Append single-choice answers
if isinstance(q["answer"], list):
question_field.single_choice_answers.answers.extend(q["answer"])
else:
question_field.single_choice_answers.answers.append(q["answer"])

lead_form.fields.append(question_field)

# Handle custom (text-based) qualifying questions
else:
custom_question = client.get_type("LeadFormCustomQuestionField", version="v20")()
custom_question.question_text = q["question"]

# Add single-choice options only if at least 2 choices are given
if isinstance(q["answer"], list) and len(q["answer"]) >= 2:
choice_answers = client.get_type("LeadFormSingleChoiceAnswers", version="v20")()

choice_answers.answers.extend(q["answer"])
custom_question.single_choice_answers = choice_answers

lead_form.custom_question_fields.append(custom_question)

except Exception as e:
logging.warning(f"⚠️ Error in qualifying question '{q}': {e}")

Google Ads API Forum Advisor

unread,
Jul 17, 2025, 10:40:22 AMJul 17
to rajat.sing...@gmail.com, adwor...@googlegroups.com

Hi,

As per provided information, I understand that you are getting an error while creating the lead form asset through the Google Ads API. Please understand that without complete API logs, our team would not be able to assist you further. Kindly note that you have provided the python logs. So, kindly provide us with the complete API logs (request and response logs with request-id and request header) or share at least request IDs generated at your end to investigate your issue further.

Kindly note that you are using a client library and haven't enabled the logging yet, I would request you to enable logging for the specific client library that you are using. You can refer to the guides Java, .Net, PHP, Python, Ruby or Perl to enable logging at your end. For REST interface requests, you can enable logging via the curl command by using the -i flag.

Thanks,
 
Google Logo Google Ads API Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5

[2025-07-17 14:39:22Z GMT] This message is in relation to case "ref:!00D1U01174p.!500Ht01svNXa:ref" (ADR-00318348)



Rajat Singh

unread,
Jul 17, 2025, 11:00:35 AMJul 17
to Google Ads API and AdWords API Forum

I have sent you the correct cURL request, code, and logs in the 'Reply to author' section."
Thanks
Reply all
Reply to author
Forward
0 new messages