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
On Tuesday, July 15, 2025 at 5:04:50 PM UTC+5:30 Google Ads API Forum
Advisor wrote:
> 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*
> <https://developers.google.com/google-ads/api/reference/rpc/v20/LeadFormCustomQuestionField#:~:text=Fields-,custom_question_text,-string>
>
> field to a *LeadFormCustomQuestionField*
> <https://developers.google.com/google-ads/api/reference/rpc/v20/LeadFormCustomQuestionField>
>
> through the *assets.mutate*
> <https://developers.google.com/google-ads/api/rest/reference/rest/v20/customers.assets/mutate?apix=true>
>
> operation through the Google Ads API to create the custom questions. Kindly
> note that the *custom_question_text*
> <https://developers.google.com/google-ads/api/reference/rpc/v20/LeadFormCustomQuestionField#:~:text=Fields-,custom_question_text,-string>
>
> 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*
> <https://developers.google.com/google-ads/api/samples/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*
> <https://developers.google.com/google-ads/api/docs/concepts/field-service#request>
>
> and* response*
> <https://developers.google.com/google-ads/api/docs/concepts/field-service#response>
>
> with* request-id*
> <https://developers.google.com/google-ads/api/docs/concepts/call-structure#request-id>
>
> and* request header*
> <https://developers.google.com/google-ads/api/docs/concepts/call-structure#request_headers>)
>
> generated at your end.
>
> You can send the details via *Reply privately to the author option*, or
> *direct
> private reply* to this email.
> Thanks,
>
>
> [image: Google Logo] Google Ads API Team
> Feedback
> How was our support today?
>
> [image: rating1]
> <https://docs.google.com/forms/d/e/1FAIpQLSeRhIg5VeThVmbcD0c5DTWTDjmpJuSktN8vFelEL7_KV_Orbg/viewform?usp=pp_url&entry.141427034=1&entry.295079254=500Ht00001svNXaIAM>
>
> [image: rating2]
> <https://docs.google.com/forms/d/e/1FAIpQLSeRhIg5VeThVmbcD0c5DTWTDjmpJuSktN8vFelEL7_KV_Orbg/viewform?usp=pp_url&entry.141427034=2&entry.295079254=500Ht00001svNXaIAM>
>
> [image: rating3]
> <https://docs.google.com/forms/d/e/1FAIpQLSeRhIg5VeThVmbcD0c5DTWTDjmpJuSktN8vFelEL7_KV_Orbg/viewform?usp=pp_url&entry.141427034=3&entry.295079254=500Ht00001svNXaIAM>
>
> [image: rating4]
> <https://docs.google.com/forms/d/e/1FAIpQLSeRhIg5VeThVmbcD0c5DTWTDjmpJuSktN8vFelEL7_KV_Orbg/viewform?usp=pp_url&entry.141427034=4&entry.295079254=500Ht00001svNXaIAM>
>
> [image: rating5]
> <https://docs.google.com/forms/d/e/1FAIpQLSeRhIg5VeThVmbcD0c5DTWTDjmpJuSktN8vFelEL7_KV_Orbg/viewform?usp=pp_url&entry.141427034=5&entry.295079254=500Ht00001svNXaIAM>
>
> [2025-07-15 11:33:48Z GMT] This message is in relation to case
> "ref:!00D1U01174p.!500Ht01svNXa:ref" (ADR-00318348)
>
>
>
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
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
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/adwords-api/9483c2da-13f2-4172-ad15-2e12e6c80e02n%40googlegroups.com.