Querying for Pmax asset_group reporting with metrics by API

458 views
Skip to first unread message

Mike Fang

unread,
Oct 18, 2023, 2:26:02 AM10/18/23
to Google Ads API and AdWords API Forum
Hi,
Based on this article, I can get the metrics data from UI for asset_group in Pmax campaign
But can I get these data via API?
I try to send this query
SELECT
metrics.clicks,
metrics.impressions
FROM asset_group where asset_group.id = '6479664517' and segments.date DURING LAST_MONTH
ORDER BY metrics.impressions DESC
but I got an error 
"Cannot select or filter on the following metrics: 'clicks'(could not support requested resources: 'ASSET_GROUP'), 'impressions'(could not support requested resources: 'ASSET_GROUP'), since metric is incompatible with the resource in the FROM clause or other selected segmenting resources."

so my question is if we can query for pmax sset_group reporting with metrics by API?

Thanks
Mike

Google Ads API Forum Advisor

unread,
Oct 18, 2023, 5:10:01 AM10/18/23
to mike...@placements.io, adwor...@googlegroups.com
Hi Mike,

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

After reviewing your concern, I understand that your query is regarding the asset_group in the PMax campaign. However, there are some limitations for Performance Max (PMax) asset group reporting with metrics by API. The asset_group resource does not support metric selection or filtering. This is why you received the error message when you tried to query for the clicks and impressions metrics.

To get asset group performance metrics, you can use the asset_group_product_group_view resource. This resource allows you to segment your results by product group, but you can also limit the results to a single asset group by adding an asset group filtering condition to the WHERE clause.

The following example demonstrates how to use the asset_group_product_group_view resource to retrieve performance metrics by asset group:

SELECT
  asset_group.name,
  metrics.impressions,
  metrics.clicks,
  metrics.cost_micros
FROM asset_group_product_group_view
WHERE asset_group.id = '6479664517'
AND segments.date DURING LAST_MONTH
ORDER BY metrics.impressions DESC

Also, you can utilize the Google Ads Query Builder and Query Validator to build and validate the queries for retrieving the data from the Google Ads API. If you have any concerns / queries related to Google Ads API, please feel free to get back to us. 

 
This message is in relation to case "ref:!00D1U01174p.!5004Q02pU79C:ref"

Thanks,
 
Google Logo Google Ads API Team

 

Mike Fang

unread,
Oct 18, 2023, 10:14:24 PM10/18/23
to Google Ads API and AdWords API Forum
Thanks!

Pere Munar

unread,
Nov 24, 2023, 5:38:18 AM11/24/23
to Google Ads API and AdWords API Forum
Hi!

I tried to get data from the asset_group_product_group_view report and I got some data. However, the data retrieved does not match the data displayed on the Google Ads platform.
Any ideas on what might be happening? Are you aware of that issue?

Best,

Pere

Roland Abdallah

unread,
Dec 7, 2023, 10:21:59 AM12/7/23
to Google Ads API and AdWords API Forum
Hello  Google Ads API Forum Advisor,

can you send me a query similar to Mike to extract all account data on asset group level rather for a specific asset group id?

Thank you

Google Ads API Forum Advisor

unread,
Dec 7, 2023, 2:39:42 PM12/7/23
to roland....@performics.com, adwor...@googlegroups.com
Hi,

Thank you for getting back to us. 

By reviewing your concern, I understand that you want to retrieve account data on asset group level from the Google Ads API. In order to further investigate, kindly provide us the uncropped UI screenshot of the Google Ads account and also highlight the fields and metrics that you require to retrieve via the API.

Google Ads API Forum Advisor

unread,
Dec 7, 2023, 2:44:41 PM12/7/23
to roland....@performics.com, adwor...@googlegroups.com
Hi,

Thank you for getting back to us. 

Please ignore my previous email.


By reviewing your concern, I understand that you want to retrieve account data on asset group level from the Google Ads API. In order to further investigate, kindly provide us the uncropped UI screenshot of the Google Ads account and also highlight the fields and metrics that you require to retrieve via the API.

You can send the details via Reply privately to the author option, or direct private reply to this email.
Reply all
Reply to author
Forward
0 new messages