Obtaining AdGroupId

55 views
Skip to first unread message

ironside....@gmail.com

unread,
May 11, 2018, 7:43:25 AM5/11/18
to AdWords API and Google Ads API Forum
Hi. I'm looking for a way to get my AdGroupId. Here's part of my code:

var seedAdGroupIdSearchParameter = new SeedAdGroupIdSearchParameter();
seedAdGroupIdSearchParameter.adGroupId = ????????;
searchParameters.Add(seedAdGroupIdSearchParameter);
searchParameters.Add(relatedToQuerySearchParameter);

Where do I get the adGroupId from?

Bharani Cherukuri (AdWords API Team)

unread,
May 11, 2018, 3:20:56 PM5/11/18
to AdWords API and Google Ads API Forum
Hello, 

You can retrieve the Targeting ideas by providing the Ad Group ID with the SeedAdGroupIdSearchParameter. If you already have an existing Ad group in your account, you could use the AdGroupService.get() to get the AdGroup Ids associated with the campaign. If not, you could create a new Ad Group using the AdGroupService.mutate() request. Please take a look at the code samples in Java on how to Get AdGroups and Add AdGroups as a reference. Code samples in other languages can be found here. You can use the desired ad group Id to pull the Targeting ideas information. 

Let me know if you have any other questions. 

Regards,
Bharani, AdWords API Team

ironside....@gmail.com

unread,
May 12, 2018, 3:12:34 AM5/12/18
to AdWords API and Google Ads API Forum
So if I understand correctly I'll need to create a new campaign, with ad group in it and use its adGroup ID to get the keywords?
If so, I'm trying to create a new campaign, but I seem to be unable to pick an account (screenshot attached). I'm using Chrome v.64, in incognito mode.
All I want to do is get the keyword ideas.

Bharani Cherukuri (AdWords API Team)

unread,
May 14, 2018, 12:35:33 PM5/14/18
to AdWords API and Google Ads API Forum
Hello, 

You will be able to generate Keyword ideas based on a number of inputs. In your use case, it looks like you're using AdGroup Id to generate the keyword ideas. If you do not wish to use AdGroup Id, you will be able to use other inputs listed here, to generate ideas. 

This said, the screenshot attachment is missing on this thread. You will be able to create campaigns both from the AdWords API and the UI by specifying the client account customer ID. Through the API, you may refer to the AddCampaigns code sample in Java. Code samples in other languages can be found here. If you're using UI, you can follow the steps mentioned in this guide
Reply all
Reply to author
Forward
0 new messages