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?
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)
";