Copy OR Move Google Ads from one AdGroup to another

90 views
Skip to first unread message

Aseem Thapliyal

unread,
Jan 21, 2021, 7:26:40 AM1/21/21
to AdWords API and Google Ads API Forum
Hi,

I am a newbie to the whole Google Ads API and one of the things that I need to achieve is to move OR copy Google Ads from one AdGroup to another using the REST interface but I can't seem to figure out a way to do that. It can be achieved using the Google Ads console(UI) and the editor. 

If it can be done using the Google Ads API REST interface (assuming some code powers the Ads console), it would be very helpful.

Thanks.

- Aseem


Google Ads API Forum Advisor Prod

unread,
Jan 21, 2021, 10:27:22 PM1/21/21
to adwor...@googlegroups.com
Hi Aseem,

Moving ads to another ad group is not possible via the API. 

However, you should be able to get its attributes via an AdGroupAdService.GetAdGroupAdRequest. Afterwards, you can perform a mutate request to create a new ad to a new ad group using the details retrieved.

To construct your REST interface request, you may derive it using the below relevant documentation :

REST Interface
Design
Get methods
Mutate methods
Discovery document for V6

I hope this helps.

Best regards,

Google Logo
Peter Laurence Napa Oliquino
Google Ads API Team
 


ref:_00D1U1174p._5004Q2B29bw:ref

Aseem Thapliyal

unread,
Jan 22, 2021, 2:32:43 AM1/22/21
to AdWords API and Google Ads API Forum
Hi Peter Laurence Napa Oliquino,

Thanks for your help.
Is there a way to list resources like Campaigns, Ad Groups, Ad Group Ads, etc using the API?

Thanks.

- Aseem

Floyd van der weij

unread,
Jan 22, 2021, 3:52:22 AM1/22/21
to AdWords API and Google Ads API Forum
{this is PHP but the libary should be mostly the same} : 
When Calling Elements from a Stream Aka : $Stream = $Connection->searchStream($CustomerID, $Query);

When you Foreach The Data you usually have something like this :
foreach ($Stream->iterateAllElements() as $Element) {

  // ALL Data out of the Object Campaign.
  $campaign = $Element->GetCampaign('"');
  // Name.
  $name = $Element->GetName();
  // Status.
  $status = $Element->?????();

}
Status is unknown but, you can find that at :
(Depending on libary, But in V6 its usually) :
google-ads-php/src/Google/Ads/GoogleAds/V6/Recources/Campaign.php
Or if you have something like AdGroups
google-ads-php/src/Google/Ads/GoogleAds/V6/Recources/AdGroup.php

these 2 you can find things for Reporting data

also good to know in what dimention/Layer Data is located 

aka what do you need to call to get that certain thing.


--------------------------------------
If you need ads for example
you First need to give an CustomerID With an CampaignID then The Adgroup and then the AD

and more things like that.
Picture :
image-maps-overview.png
Op vrijdag 22 januari 2021 om 08:32:43 UTC+1 schreef aseem.t...@hotel-spider.com:

Floyd van der weij

unread,
Jan 22, 2021, 3:54:06 AM1/22/21
to AdWords API and Google Ads API Forum
*reading back my code i made a huge mistake*

I meant : 


foreach ($Stream->iterateAllElements() as $Element) {

  // ALL Data out of the Object Campaign.
  $campaign = $Element->GetCampaign('"');

  // Name.
  $name = $campaign->GetName();
  // Status.
  $status = $campaign ->?????();

}

i changed 

$name = $campaign->GetName();
  // Status.
  $status = $campaign ->?????();  

my applogies 
Op vrijdag 22 januari 2021 om 09:52:22 UTC+1 schreef Floyd van der weij:

Google Ads API Forum Advisor Prod

unread,
Jan 25, 2021, 2:42:01 AM1/25/21
to floy...@gmail.com, adwor...@googlegroups.com
Hi Aseem,

I am a colleague of Peter and let me provide support to your concern.

With regard to the below question, if what you want is to get the data and metrics of specific resources, then I would suggest using Google Ads API reporting. To give you examples, if you want to list the data and metrics at the campaign level, then you will need to use campaign report.

"Is there a way to list resources like Campaigns, Ad Groups, Ad Group Ads, etc using the API?"

If I misunderstood the above question, then please provide more details to further check.

Moving forward to the second concern about the code, could you confirm if there is any concerns or issues related to that so we can check as well?

Regards,
Google Logo
Ernie John Blanca Tacata
Google Ads API Team
 


ref:_00D1U1174p._5004Q2B29bw:ref

Aseem Thapliyal

unread,
Jan 25, 2021, 3:45:19 AM1/25/21
to AdWords API and Google Ads API Forum
Hi Ernie,

Thanks for the reply. So what I basically want is to create something where all the resources are listed first and then if the user clicks on a resource, the backend will fetch the details of that resource. So for instance I want to show all the campaigns or Ads inside and Ad group to the user first and then if the user clicks on a campaign, the backend will fetch details of that and so on. So that's why my query was around the listing of resources. (Campaigns, Ad Groups, Ad Group Ads, etc) 

Thanks.

- Aseem

Google Ads API Forum Advisor Prod

unread,
Jan 25, 2021, 9:27:02 PM1/25/21
to adwor...@googlegroups.com
Hi Aseem,

To fetch the details of the 'resource' you will need to use its respective service (v6 > services) or view/report. For the entities / resources that you mentioned, as an example, you can use the below services to invoke a get request to retrieve them and their attributes :

Campaigns - CampaignService
Ad Groups - AdGroupService
Ads - AdGroupAdService

Best regards,

Google Logo
Peter Laurence Napa Oliquino
Google Ads API Team
 


ref:_00D1U1174p._5004Q2B29bw:ref

Aseem Thapliyal

unread,
Feb 5, 2021, 7:09:54 AM2/5/21
to AdWords API and Google Ads API Forum
Hi Peter,

Thanks again for your help.
I was working on hotel campaigns and hotel ad groups and I was wondering if I can list down the hotels present in a hotel group and also add OR remove a hotel from a hotel group using the API?

Best Regards,
Aseem

Google Ads API Forum Advisor Prod

unread,
Feb 8, 2021, 12:07:24 AM2/8/21
to adwor...@googlegroups.com
Hi Aseem,

Thank you for your follow up.

In the Google Ads API, hotels can be partitioned into hotel listing groups. If you wish to manage these listing groups, you can check out this related guide. In addition, you should be able to manage these listing groups using the AdGroupCriterionService. I hope this helps.
Reply all
Reply to author
Forward
0 new messages