Get object hierarchy (campaigns, ad groups, ad group ads, ads) set in UI for the given account using AdWords API

70 views
Skip to first unread message

Jaroslav Mazurak

unread,
Jan 21, 2021, 8:39:19 AM1/21/21
to AdWords API and Google Ads API Forum

Hello All,

I have access to a specific account and want to retrieve the full hierarchy of its objects before getting the analytics. For this purpose, I use the appropriate service objects and method get(). The selectors are built with only a field list and page limit, without dateRange, predicates, etc.
The problem is that when I use the CampaignService I can't get video campaigns (it's documented) and the campaigns that haven't started yet.
I can get all campaigns (including video) using Campaign Performance Report without metrics and with zero impressions.
I can get non-started campaigns by the Campaign Criteria Report.
Now I want to get all Ad Groups (using AdGroupService), Ad Group Ads (using AdGroupAdService), and Ads (using AdService).
But when I try to receive them I get only one ad group and one ad group ad. However, when I try to get all ads I receive ~1800 ads.
If I understand correctly, the selector predicates are only the limiting clauses, so the less predicates I set the broad response I get.
I think that it's impossible to have so many ads and only one ad group ad. I suspect that there are similar pitfalls as in the case with campaigns.

So the question is what is the right approach to get all account dimensional data such as campaigns, ad groups, ad group ads, and ads?

Google Ads API Forum Advisor Prod

unread,
Jan 22, 2021, 12:37:22 AM1/22/21
to jama...@gmail.com, adwor...@googlegroups.com
Hi Jaroslav,

Both the API's services and reports can be used to retrieve the attributes/fields data that you are looking for. However, you would need to identify whether there is support in the said service/report for the 'types' of entities that are present in your account. 

If you are using the AdWords API, some types of campaigns may not be retrievable due to its limited support. For this scenario, you may consider using the Google Ads API instead due to its broader support for campaign types, as you may see in the below example using campaign (report) fields :

advertising_channel_type
advertising_channel_sub_type

Also, since you mentioned ad limits per ad group, you can check out this article as well for more information on the entity limits of a Google Ads account.

Best regards,

Google Logo
Peter Laurence Napa Oliquino
Google Ads API Team
 


ref:_00D1U1174p._5004Q2B2Ais:ref

Jaroslav Mazurak

unread,
Jan 22, 2021, 4:17:07 AM1/22/21
to AdWords API and Google Ads API Forum
Hi Peter,

thank you for your answer but you've suggested again to use report(s) to get the information about entities and their hierarchy.
I wonder if it's possible to get all this information using service objects and get / query methods (except for the documented exceptions such as video campaigns)? If not, then what is the purpose of those get / query methods?
In my case, there is an account with 50 campaigns 48 of which are video. OK, I've got 2 campaigns from the CampaignService and 50 from the Campaign Performance Report.
Now I want to retrieve AdGroups, and get them for the non-video campaigns.
Same for AdGroup Ads.
Thus currently, I can't link ~1800 ads to the corresponding AdGroup Ads / AdGroups / Campaigns.
Google Ads API said that "Not all campaign types in the Google Ads UI are supported in the API, such as Video Campaigns. Video campaign metrics are available for retrieval in the API. However, video campaigns cannot be mutated at all from the API, including simple operations such as pausing or enabling as well as complex operations like organizing, changing criteria, or adding ad groups."
It's somewhat confusing because I want to get some descriptional data, not metrics. And Google Ads API should be enabled explicitly. So I'm still not sure if the Google Ads API can meet my expectations.

пʼятниця, 22 січня 2021 р. о 07:37:22 UTC+2 adsapiforumadvisor пише:

Google Ads API Forum Advisor Prod

unread,
Jan 25, 2021, 4:54:12 AM1/25/21
to jama...@gmail.com, adwor...@googlegroups.com
Hi Jaroslav,

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

My colleague, provided the campaign report as an example only, since you would not be able to retrieve video campaigns via the services of the Google Ads API.

As mentioned earlier as well by my colleague, both services and reports can be used to retrieve your Google Ads accounts' entities. You should also be able to use the GoogleAdsService search or searchStream to get the hierarchy from campaign to ads, however, please also take not of some differences as described here, for campaigns.

That said, let me raise a feature request so that video campaign would be supported in Google Ads API service, specifically the CampaignService. Please note that this request will be subject for review.

For the meantime, please follow our blog to receive updates and new releases.

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


ref:_00D1U1174p._5004Q2B2Ais:ref

Jaroslav Mazurak

unread,
Jan 25, 2021, 4:17:59 PM1/25/21
to AdWords API and Google Ads API Forum
Hi Ernie,

It would be great to have a comprehensive API set. Without some entities, the current API can't be used in the production environment. The Campaign Performance report is used due to the absence of entities in the current API service object, and it stands at least for 2+ years...

понеділок, 25 січня 2021 р. о 11:54:12 UTC+2 adsapiforumadvisor пише:

Google Ads API Forum Advisor Prod

unread,
Jan 26, 2021, 12:47:29 PM1/26/21
to jama...@gmail.com, adwor...@googlegroups.com
Hi Jaroslav,

Although the Ads API does not support video campaign creation/modification, there are alternatives. For example, Ads scripts provides this functionality. If you have any questions for the scripts team, please let us know and we can put you in touch with them.

Regards,
Matt
Google Ads API Team

Google Logo
Matt
Google Ads API Team
 


ref:_00D1U1174p._5004Q2B2Ais:ref

Jaroslav Mazurak

unread,
Jan 26, 2021, 3:42:04 PM1/26/21
to Google Ads API Forum Advisor Prod, adwor...@googlegroups.com
Hi Matt,

Thank you for pointing to the Google Ads Scripts API but I wonder why
there are different SDKs with a different feature set?
Currently, I'm using Java SDK because it better integrates with the
backend infrastructure, and see limitations of the current SDKs. Now you
suggest the ECMAScript SDK inside the interactive editor but I see a
"good old" AdWords / Google Ads API entities beyond it, and obvious "Get
all campaigns" example
(https://developers.google.com/google-ads/scripts/docs/examples/campaigns)...
Maybe better will be split the infrastructure API and user SDKs and
release the API specification with an endpoint list and specify the
access using Swagger / Protobuf (Google Ads API?) / SOAP XML (AdWords
API?) / plain HTML with the AWQL / GAQL inside it etc.? And then as many
as needed user SDKs can be released if they are needed.


26.01.2021 19:47, Google Ads API Forum Advisor Prod пише:


> Although the Ads API does not support video campaign
> creation/modification, there are alternatives. For example, Ads scripts
> <https://developers.google.com/google-ads/scripts> provides this
> functionality. If you have any questions for the scripts team, please
> let us know and we can put you in touch with them.
>
> Regards,
> Matt
> Google Ads API Team
>
> ref:_00D1U1174p._5004Q2B2Ais:ref

Reply all
Reply to author
Forward
0 new messages