Updating Lead From Asset issue

89 views
Skip to first unread message

Anna Lysak

unread,
Sep 8, 2022, 5:26:51 AM9/8/22
to Google Ads API and AdWords API Forum
Hi Google Team,
Could you please help on my question?
I run update request:
params = {
"operations": [{
"updateMask": "name,leadFormAsset.businessName,leadFormAsset.fields",
"update": {
"resourceName": "customers/XXXXX/assets/XXXXX",
"name": "My Lead Form #12345",
"type": "LEAD_FORM",
"final_urls": ["XXXXXX"],
"leadFormAsset": {
"businessName": "Cats LTD New",
"callToActionType": "LEARN_MORE",
"callToActionDescription": "Learn more",
"headline": "New Test Lead Form23",
"description": "New Test Lead Form description",
"privacyPolicyUrl": "XXXXX",
"fields": [
{
"inputType": "EMAIL"
},
{
"inputType": "FIRST_NAME"
},
{
"inputType": "LAST_NAME"
},
{
"inputType": "PHONE_NUMBER"
},
{
"inputType": "COUNTRY"
},
{
"inputType": "CITY"
},
],
"postSubmitCallToActionType": "VISIT_SITE",
"desiredIntent": "LOW_INTENT",
"postSubmitHeadline": "Thank you!",
"postSubmitDescription": "Thanks for filling Lead Form",

}

}
}],
}

I've added 1 field : CITY, but I receive response, that fields is Immutable, but in documentation it is not immutable. Do I have possibility to update fields (add/remove) question?
Response with request ID is the following:
 {
    "error": {
        "code": 400,
        "message": "Request contains an invalid argument.",
        "status": "INVALID_ARGUMENT",
        "details": [
            {
                "@type": "type.googleapis.com/google.ads.googleads.v11.errors.GoogleAdsFailure",
                "errors": [
                    {
                        "errorCode": {
                            "fieldError": "IMMUTABLE_FIELD"
                        },
                        "message": "The field attempted to be mutated is immutable.",
                        "location": {
                            "fieldPathElements": [
                                {
                                    "fieldName": "operations",
                                    "index": 0
                                },
                                {
                                    "fieldName": "update"
                                },
                                {
                                    "fieldName": "lead_form_asset"
                                },
                                {
                                    "fieldName": "fields"
                                }
                            ]
                        }
                    }
                ],
                "requestId": "wcz8z2YNaAuNLawWN8rU6Q"
            }
        ]
    }
}
Could you please help me on this?

Thanks.

Google Ads API Forum Advisor

unread,
Sep 8, 2022, 10:14:16 AM9/8/22
to gann...@gmail.com, adwor...@googlegroups.com
Hi Anna,

Thanks for reaching out. Please allow me to raise this issue to our team and we will provide an update shortly. 

Regards,

Google Logo
Matt
Google Ads API Team
 


ref:_00D1U1174p._5004Q2dwfov:ref

Anna Lysak

unread,
Sep 12, 2022, 3:45:14 AM9/12/22
to Google Ads API and AdWords API Forum
Hi Matt,
Do you have any updates on this issue?
Thanks

Anna Lysak

unread,
Sep 15, 2022, 6:23:52 AM9/15/22
to Google Ads API and AdWords API Forum
Hi Matt, 
is it possible to update questions list (add/remove) through the API?

Thanks.

Google Ads API Forum Advisor

unread,
Sep 15, 2022, 2:56:38 PM9/15/22
to gann...@gmail.com, adwor...@googlegroups.com
Hi Anna,

Thanks for following up. I'm a developer relations engineer jumping in to help out here.

For your first question, I believe it's not possible to update the lead_form_asset.fields field on an Asset, but I am double-checking with the team to make sure. It's possible our documentation may not be specific enough on this point.

And for your second questions, I'm not entirely sure what you mean, could you please elaborate?

Thanks,
Google Logo
Ben Karl
Google Ads API Team
 


ref:_00D1U1174p._5004Q2dwfov:ref

Anna Lysak

unread,
Sep 16, 2022, 3:52:55 AM9/16/22
to Google Ads API and AdWords API Forum
Hi Karl, thank you for reply.

Second question was related to 1st one for example I created lead form with this body:
params = {
"operations": [{
"create": {

"resourceName""customers/XXXXX/assets/XXXXX",
"name""My Lead Form #12345",
"type""LEAD_FORM",
"final_urls": ["XXXXXX"],
"leadFormAsset": {
"businessName""Cats LTD New",
"callToActionType""LEARN_MORE",
"callToActionDescription""Learn more",
"headline""New Test Lead Form23",
"description""New Test Lead Form description",
"privacyPolicyUrl""XXXXX",
"fields": [
{
"inputType""EMAIL"
},
{
"inputType""FIRST_NAME"
},
{
"inputType""LAST_NAME"
},
{
"inputType""PHONE_NUMBER"
},
{
"inputType""COUNTRY"
}
],
"postSubmitCallToActionType""VISIT_SITE",
"desiredIntent""LOW_INTENT",
"postSubmitHeadline""Thank you!",
"postSubmitDescription""Thanks for filling Lead Form",

}

}
}],
}
and I want to update lead form asset, by removing field :
{
"inputType""COUNTRY"
}
and add field:
{
"inputType""CITY"
},
So I do Update request:

params = {
"operations": [{
"updateMask""name,leadFormAsset.businessName,leadFormAsset.fields",
"update": {
"resourceName""customers/XXXXX/assets/XXXXX",
"name""My Lead Form #12345",
"type""LEAD_FORM",
"final_urls": ["XXXXXX"],
"leadFormAsset": {
"businessName""Cats LTD New",
"callToActionType""LEARN_MORE",
"callToActionDescription""Learn more",
"headline""New Test Lead Form23",
"description""New Test Lead Form description",
"privacyPolicyUrl""XXXXX",
"fields": [
{
"inputType""EMAIL"
},
{
"inputType""FIRST_NAME"
},
{
"inputType""LAST_NAME"
},
{
"inputType""PHONE_NUMBER"
},
{
"inputType""CITY"
},
],
"postSubmitCallToActionType""VISIT_SITE",
"desiredIntent""LOW_INTENT",
"postSubmitHeadline""Thank you!",
"postSubmitDescription""Thanks for filling Lead Form",

}

}
}],
}

But it doesn't work, response is I can't update leadFormAsset.fields  field. So is it possible to add/remove question(update "fields") in leadFormAsset  somehow ?
Thanks in advance.

Anna Lysak

unread,
Sep 16, 2022, 3:53:53 AM9/16/22
to Google Ads API and AdWords API Forum
Sorry, I said Karl, I meant Ben :)

Google Ads API Forum Advisor

unread,
Sep 23, 2022, 3:24:05 PM9/23/22
to gann...@gmail.com, adwor...@googlegroups.com
Hi Anna,

No problem :) 

Apologies for my delayed response. I do have some clarification here. The field is technically mutable, however it's only possible to re-order the items in the list, not to add or remove any.

We're actually in the process of updating the comment on the field to clarify this in our documentation. 

Hope this help! Please let me know if you have any questions.

Best,
Reply all
Reply to author
Forward
0 new messages