Migration from AD_PERFORMANCE_REPORT to ad_group_ad

95 views
Skip to first unread message

Miryam Miryam

unread,
Jun 23, 2021, 5:03:31 PM6/23/21
to AdWords API and Google Ads API Forum
I've been trying to run this query, but it always returns duplicate records for the same ad.id, but each with different data (clicks, impressions, CPC, ...etc), each for a different day within the range added in the query, What I need is the summation for all of those fields for the same ad.id, as if we're grouping by the ad.id, the same way it used to happen in the AD_PERFORMANCE_REPORT in adwards, any help?

$query = "SELECT  ad_group_ad.ad.type, ad_group.name, ad_group_ad.ad.name,
                        metrics.clicks, metrics.impressions, metrics.ctr, metrics.average_cpc,
                        ad_group_ad.ad.responsive_search_ad.headlines,
                        ad_group_ad.ad.responsive_search_ad.descriptions,
                        ad_group_ad.ad.expanded_text_ad.description, ad_group_ad.ad.expanded_text_ad.description2,
                        ad_group_ad.ad.text_ad.headline,
                        ad_group_ad.ad.text_ad.description1, ad_group_ad.ad.text_ad.description2,
                        ad_group_ad.ad.expanded_text_ad.headline_part1, 
                        ad_group_ad.ad.expanded_text_ad.headline_part2,
                        ad_group_ad.ad.expanded_text_ad.headline_part3,
                        ad_group_ad.ad.final_urls, metrics.cost_micros, segments.date
                FROM ad_group_ad  WHERE segments.date BETWEEN '$startDate' AND '$endDate'  AND campaign.id IN ($campaigns)
               ";

Google Ads API Forum Advisor

unread,
Jun 24, 2021, 1:59:50 AM6/24/21
to miryamm...@gmail.com, adwor...@googlegroups.com
Hi Miryam,

Thank you for posting your concern.

Upon checking your query, I can see that you've included the segments.date and this is the possible reason why your are retrieving this set of data. However, this is the expected result as segment fields such as segments.date will break down the ads' metrics per date. This behavior is also applicable to AD_PERFORMANCE_REPORT that when including segment field, it will returns duplicate records for the same ad.id, but each with different data.

Yet, the data and information of ad_group_ad and AD_PERFORMANCE_REPORT should be matched.

But to confirm if this is indeed the scenario, could you provide the following details via Reply privately to author option?
  • Complete report definition that you've used in the AD_PERFORMANCE_REPORT
  • Complete request and response logs with request ID generated on your end for ad_group_ad
  • Customer ID of the Google Ads account where you are generating report

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


ref:_00D1U1174p._5004Q2IyDvk:ref
Reply all
Reply to author
Forward
0 new messages