How to Reproduce This UI Report With The API?

249 views
Skip to first unread message

Chad Wood

unread,
Jun 2, 2023, 12:41:47 PM6/2/23
to Google Ads API and AdWords API Forum
Hello, hope all is well

I would like to reproduce the following report with the API (screenshot at bottom).
Disregarding the dates, how can I structure my query to receive the
0. `Ad ID`,
1. `Approval Reasons`,
2. `Ad State`, and
3. `Ad Status` ?

Second, is there any way to get the historic states/statuses/reasons of the ads? If an ad is removed today, can I see what its status was yesterday? Lastly, is there a maximum amount of time before I can no longer see historic states of ads?

Thanks!

Report-editor-Google-Ads.png



Chad Wood

unread,
Jun 2, 2023, 4:54:06 PM6/2/23
to Google Ads API and AdWords API Forum
Hello, I've made some progress since the last email. Feel free to disregard it and I'll just update the thread.I've moved the questions still in need of help to the bottom of this email.
For reference, I was able to get the data I wanted with the following query (extra stuff in here too):

SELECT
  ad_group_ad.ad.id,
  ad_group_ad.ad.name,
  ad_group_ad.ad_group,
  ad_group_ad.status,
  ad_group_ad.policy_summary.review_status,
  ad_group_ad.policy_summary.approval_status,
  ad_group_ad.policy_summary.policy_topic_entries,
  ad_group.id,
  ad_group.name,
  ad_group.campaign,
  ad_group.status,
  campaign.id,
  campaign.name,
  campaign.status,
  campaign.serving_status,
  campaign.primary_status,
  campaign.primary_status_reasons
FROM ad_group_ad

One thing I didn't see that would be nice is something like "last served date" or "last impression date" at the ad level, to get a sense for when the ad was last used.
Is there another way to figure out when an ad was last used?

Also is there any way to check what previous states of an ad were, at a given time? I'm interested in a time series analysis of statuses at the ad level.

Thanks!

Chad Wood

unread,
Jun 5, 2023, 10:53:57 AM6/5/23
to Google Ads API and AdWords API Forum
Hello, just following back up. I'll summarize my questions below:

1. Is there any way to figure out when an ad was last used?(last serve date, last impression date, ...?)
2. Is there any way to check what previous states of an ad were, at a given time? (historic ad states?)

Google Ads API Forum Advisor

unread,
Jun 6, 2023, 4:56:42 PM6/6/23
to chadwo...@gmail.com, adwor...@googlegroups.com

Hi Chad, 

Thanks for reaching out to the Google Ads API Team. I hope you are doing well today.

With regards to your 1st concern from your 1st email, thank you for confirming that the issue has been resolved on your end. We highly appreciate your shared information.

Moving forward to your another email that concerns “last serve date, last impression date and historic ad states”, could you please provide us with Google Ads UI uncropped screenshot? For us to provide accurate information and recommendations.

Please note that Google Ads API mirrors the Google Ads UI. Meaning by using the Google Ads API, you can get and manage the data that you are seeing in the UI.

On the other hand, if this is related to the same report type, you may use the ad_group_ad reporting to check on you end the available resources, fields, segments, and metrics (https://developers.google.com/google-ads/api/fields/v13/ad_group_ad_query_builder).

Have a great day.
 

This message is in relation to case "ref:_00D1U1174p._5004Q2lwDrZ:ref"

Thanks,

 
Google Logo Google Ads API Team


Chad Wood

unread,
Jun 7, 2023, 10:29:03 AM6/7/23
to Google Ads API and AdWords API Forum
Hi, I dont have a screenshot of the data in the UI. I'm just wondering if it's possible to utilize any metric / dimension for the purpose. Right now, I don't see any way to differentiate between ads that haven't been served in 10 years versus ads there were served 2 days ago.

I checked, and it looks like the answer is no.

Chad Wood

unread,
Jun 7, 2023, 10:37:39 AM6/7/23
to Google Ads API and AdWords API Forum
I guess I can give my use case.

We have tens of thousands of ads on your platform. Recently, several hundred were taken offline.
I want to do an analysis into these, but I can't find an elegant way to isolate them programmatically.

I guess one way would be to query for the number of impressions every ad got on every single day we've had an account in Google Ads, then I can filter those down  to only records where impressions is greater than 1, and finally use the existence of a record as evidence that the ad was active on any given day in the datasets index.

That's a very heavy process though. I'll be working with tens of millions of rows of data (a row per ad per day).

Oliver

unread,
Jun 8, 2023, 1:28:33 AM6/8/23
to Google Ads API and AdWords API Forum
Hi Chad, I'm not from the API team but can contribute. The answer to your 2 questions is 'No'.  The API does not give any historical meta data about statuses. The only way to achieve what you want is exactly what you described in your last message.

Oliver

Google Ads API Forum Advisor

unread,
Jun 13, 2023, 4:20:00 AM6/13/23
to oliver....@gmail.com, adwor...@googlegroups.com

Hello Chad,

Thanks for getting back to us.

Please note that the API and UI mimic each other’s behavior, if you are unable to find the data in the UI, it would not be available in the API. As Oliver said “The API does not give any historical metadata about statuses. The only way to achieve what you want is exactly what you described in your last message.” With regards to what you described in your previous message on how you’d go about obtaining these data, please refer to this sample GAQL query below.

SELECT 
  segments.date, 
  ad_group_ad.ad.name, 
  ad_group_ad.ad.id, 
  metrics.impressions 
FROM ad_group_ad 
WHERE 
  segments.date BETWEEN 'YYYYMMDD' AND 'YYYYMMDD' 
  AND metrics.impressions > 0 

The data queried would be segmented by each day and only showing data for impressions that are more than 0.

I hope this information helps you.

Chad Wood

unread,
Jun 13, 2023, 12:13:33 PM6/13/23
to Google Ads API and AdWords API Forum
Hey, Thanks to both Oliver and the Google Team for this.
I see the query you've provided shifts the role of filtration onto Google, likely reducing the amount of data significantly.
Nice solution there :)

One follow up question. I find myself confused by all the different statuses between ads, adgroups, and campaigns.
Here's what I'm working with:

I can't seem to figure out how to use these statuses together, which statuses are needed and which aren't.
My team wants a report that provides the following information (daily):
# of new ads,
# of ads under review,
# of ads reviewed but not approved or disapproved yet,
# of ads approved but paused,
# of ads approved and serving,
# of ads ended,
# of ads disapproved,
# of removed ads

I can handle tracking the data on my end in a database.
Can you help me decipher those statuses so that I can count the number of ads in each stage of the ad lifecycle?
Message has been deleted

Chad Wood

unread,
Jun 13, 2023, 1:49:12 PM6/13/23
to Google Ads API and AdWords API Forum

I attached an image of my approach to getting the current state of an ad.
If I run all my ads through logic like the picture illustrates, will my result be accurate counts of the number of ads in each category?

Or am I misunderstanding the statuses still?
google_ad_status_diagram.drawio.png

Google Ads API Forum Advisor

unread,
Jun 19, 2023, 12:56:35 PM6/19/23
to chadwo...@gmail.com, adwor...@googlegroups.com

Hi Chad,

Thank you for getting back to us.

Kindly note that these statuses depend on the entity level (campaign, ad group or ad group ad) you are using. Upon checking the illustration, it appears that your understanding is correct. For your use case, I would suggest retrieving the status in ad_group_ad level (https://developers.google.com/google-ads/api/fields/v14/ad_group_ad) since you wanted to get the data for your ads. 

Additionally, if it helps, you may check this guide (https://developers.google.com/google-ads/api/docs/reporting/uireports) which maps the concepts and naming conventions for reports in the Google Ads UI to the reports that you can generate using Google Ads Query Language (GAQL) and the Google Ads API. 

Please let us know if you have further questions.

Chad Wood

unread,
Jun 19, 2023, 4:03:16 PM6/19/23
to Google Ads API and AdWords API Forum
Awesome resource there. Thanks.

One more follow up question; when the review status of an ad is UNDER_APPEAL, what will the APPROVAL_STATUS be? Will it remain DISAPPROVED throughout the appeal process, or will it revert to UNKNOWN as it is throughout the primary review process?

Google Ads API Forum Advisor

unread,
Jun 21, 2023, 7:17:29 AM6/21/23
to chadwo...@gmail.com, adwor...@googlegroups.com

Hi Chad,

Thanks for getting back with us.

With regards to review status and approval status you may refer to the PolicyReviewStatus and PolicyApprovalStatus for more information. You may also refer to the product support article to check the review status of an ad or asset for more information. 

For the review processes of these statuses, I recommend reaching out to the Google Ads Product Support Team for further assistance. They can assist you more appropriately regarding these kinds of inquiries.

Links included in this email:

Reply all
Reply to author
Forward
0 new messages