Lead form Ad

74 views
Skip to first unread message

Anna Lysak

unread,
Nov 1, 2022, 5:15:21 AM11/1/22
to Google Ads API and AdWords API Forum
Hi ! 
Could you please help me with question, how can we change Lead form Ad Headlines, Urls (right side on screenshot)? Because now we have possibility to change only Call to Action for Ad, when we create lead form asset. Where Headline 1 | Headline 2 can be set ? 


Thanks!

Screenshot at 2022-11-01 11-03-20.png

Google Ads API Forum Advisor

unread,
Nov 1, 2022, 5:49:50 PM11/1/22
to gann...@gmail.com, adwor...@googlegroups.com
Hi Anna,

To change the Headlines of an Ad you need to edit the Ad resource and its corresponding field based on the Ad type you are using. Based on your screenshot I think you are using a Responsive Search Ad so it would be the “responsiveSearchAd'' field with a ResponsiveSearchAdInfo object.

In that object you have a “headlines” field to which you can add multiple AdTextAsset objects. On each of those AdTextAsset objects you can set the “text” field to the target headline text you want to use and have other options such as pinning the headline to a position.

Let us know if you have any other questions.

Google Logo
Daniel
Google Ads API Team
 

 

ref:_00D1U1174p._5004Q2fqO3b:ref

Anna Lysak

unread,
Nov 2, 2022, 7:25:24 AM11/2/22
to Google Ads API and AdWords API Forum
Hi ! Thanks for the answer.
I still have several questions.
1. We create lead Form (by creating lead form asset using rest API), connect it to campaign (campaign_asset link). From the documentation, i see that Ad can only be updated and not created : https://developers.google.com/google-ads/api/rest/reference/rest/v12/AdOperation , how can we create Ad (not from google UI, but from API)? If Ad creation is not available from API, how can we select existing ads to get ads objects info and ids from the API to modify them?
2. How Ad can be connected to Lead Form ? Or Ad can be connected to campaign only? What API should be called to connect Ad to campaign (or to lead form, why I asking about connection to lead form, I saw that Lead form call to action is applied to ad in UI (responsive search ad))?

Thanks in advance.

Google Ads API Forum Advisor

unread,
Nov 2, 2022, 1:47:55 PM11/2/22
to gann...@gmail.com, adwor...@googlegroups.com
Hi Anna,

With regard to your questions, please see the below items:

How can we create Ad (not from google UI, but from API)?

You are able to create Ads from the API using the customer.Ad object.

About the other questions:

To add an Ad to a campaign first you need to create an AdGroup and add the Ads to the Group using an AdGroupAd operation.
An AdGroup can be linked to a campaign using its "campaign" field.

To link a LeadFormAsset to a Campaign you would use the CampaignAsset.

Finally, I know you are using the REST API and everything can be done using the REST API with the links i sent you but I would suggest to use one of our client libraries as they make this a lot easier and we have multiple examples. For example, see this one on Python about creating a LeadForm. Regardless if you decide to use a client library or not those  examples are a great resource to find the resource names in the documentation.

Regards,

Anna Lysak

unread,
Nov 4, 2022, 6:58:34 AM11/4/22
to Google Ads API and AdWords API Forum
Hi Daniel,
Thanks for the reply.

I am trying to create Ad using REST API, and I receive error that create operation is not supported. How I can create Ad using rest API? Or I should create Ad with Google UI, select Ad and update it via rest API? What if there is new campaign without AdGroup and Ads? 

My request was:
url = 'https://googleads.googleapis.com/v11/customers/XXXX/ads:mutate'
params = {
"operations": [{
"create": {
"finalUrls": ["devel.odore.com", "link.to.campaign.org"],
"type": "RESPONSIVE_SEARCH_AD",
"name": "My Ad 12345",
"responsiveSearchAd": {
"headlines": [{
"pinnedField": "HEADLINE_1",
"text": "Get Free Sample"
},
{
"pinnedField": "HEADLINE_2",
"text": "Get your free sample"
},
{
"pinnedField": "HEADLINE_3",
"text": "Get free sample from us"
},
{
"pinnedField": "DESCRIPTION_1",
"text": "Please fill in the questionnaire and you'll get free sample"
},
{
"pinnedField": "DESCRIPTION_2",
"text": "Please reply to questions and get your free sample"
}]
}

}
}]
}

And response is:
Status 400
Data {
    "error": {
        "code": 400,
        "message": "Invalid JSON payload received. Unknown name \"create\" at 'operations[0]': Cannot find field.",
        "status": "INVALID_ARGUMENT",
        "details": [
            {
                "@type": "type.googleapis.com/google.rpc.BadRequest",
                "fieldViolations": [
                    {
                        "field": "operations[0]",
                        "description": "Invalid JSON payload received. Unknown name \"create\" at 'operations[0]': Cannot find field."
                    }
                ]
            }
        ]
    }
}

Could you please help me with this? 

Google Ads API Forum Advisor

unread,
Nov 4, 2022, 12:23:08 PM11/4/22
to gann...@gmail.com, adwor...@googlegroups.com
Hi Anna,

To create an Ad you need to use the AdGroupAds Service.

Some changes you need to do in your request:

- You need to change the URL to end with: "adGroupAds:mutate" instead of "ads:mutate"
- The "operation" needs to be an AdGroupAdOperation, kindly note that "create" is a valid field there
- In the "create" field you would pass an AdGroupAd object which has an "ad" field where you can pass the info about the Ad you have in your request
Reply all
Reply to author
Forward
0 new messages