Adgroup query

525 views
Skip to first unread message

Jip Veerbeek

unread,
Dec 28, 2022, 7:22:36 AM12/28/22
to Google Ads API and AdWords API Forum
Hello team,

I want to request information of adgroups in the selected campaigns.
This is what I have now:

SELECT metrics.conversions, metrics.conversions_value, metrics.cost_micros, ad_group.effective_target_roas, ad_group.id, campaign.name, ad_group.name FROM ad_group WHERE campaign.name = 'campaign' AND segments.date DURING LAST_30_DAYS

This request works good but I can only do 1 selected campain.
Is it possible to do what I need and how can I do it?

Thanks for the help,

Jip Veerbeek

Google Ads API Forum Advisor

unread,
Dec 28, 2022, 10:32:09 AM12/28/22
to jip.ve...@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for reaching out to the Google Ads API support team.

Could you please provide full screen screenshot of the UI of what you are looking for? So that i can further investigate the issue. Please reply via privately author options.

Thanks,
Google Logo
Nirmita
Google Ads API Team
 


ref:_00D1U1174p._5004Q2hOdjO:ref

Jip Veerbeek

unread,
Dec 29, 2022, 4:24:44 AM12/29/22
to Google Ads API and AdWords API Forum
Hello,

I was wondering if it is possible to retreive all the adgroup information I want from the adgroups in the selected campaigns in 1 single request. In the request I send above I can only select 1 campaign with WHERE campaign.name = 'campaign'. 
What I need is to select this information but from 2 or more campaigns. 

Schermafbeelding 2022-12-29 102210.jpg
This is a screenshots of information I want to request with a query. In this screenshot you can see information from adgroups in 1 single campaign but I want to request this from multiple campaigns at the same time. I hope this is the information you needed.

Regards,

Jip Veerbeek

Google Ads API Forum Advisor

unread,
Dec 29, 2022, 8:49:38 AM12/29/22
to jip.ve...@gmail.com, adwor...@googlegroups.com

Hi Jip,

Thanks for getting back to us.

You may use the operator IN in your where clause to get multiple campaigns details. You may use below GAQL to get the ad group details for multiple campaigns.

 

SELECT 

  metrics.conversions, 

  metrics.conversions_value, 

  metrics.cost_micros, 

  ad_group.effective_target_roas, 

  ad_group.id

  campaign.name

  ad_group.name 

FROM ad_group 

WHERE 

  segments.date DURING LAST_30_DAYS 

  AND campaign.name IN ('campaign1', 'campaign2', 'campaign3') 

 

**Note: campaign1, campaign2, and campaign3 are the campaign names that you want to get the data for.

Alternatively, you can get information of ad groups in the selected campaigns by campaign ID below:

 

SELECT 

  metrics.conversions, 

  metrics.conversions_value, 

  metrics.cost_micros, 

  ad_group.effective_target_roas, 

  ad_group.id

  campaign.name

  ad_group.name 

FROM ad_group 

WHERE 

  segments.date DURING LAST_30_DAYS 

  AND campaign.id IN (campaignID1, campaignID2,campaignID3)


You may user query builder as well to construct your query here: https://developers.google.com/google-ads/api/fields/v12/ad_group_query_builder

Let me know if you have any additional questions.

Regards, 

Google Logo
Yasar
Google Ads API Team
 


ref:_00D1U1174p._5004Q2hOdjO:ref

Jip Veerbeek

unread,
Jan 3, 2023, 3:14:13 AM1/3/23
to Google Ads API and AdWords API Forum
Thanks!
Reply all
Reply to author
Forward
0 new messages