How to segment by conversion action name in Google Ads API?

36 views
Skip to first unread message

Dave D

unread,
Jun 25, 2020, 12:35:40 PM6/25/20
to AdWords API and Google Ads API Forum
Hi
I'm trying to get a report via the Google Ads API that returns campaigns and conversions by conversion action last week. 

query = f'''SELECT campaign.name,
                campaign.advertising_channel_type,
                segments.week,
                customer.currency_code,
                metrics.all_conversions,
                FROM campaign
                WHERE segments.week DURING LAST_WEEK_MON_SUN
                AND campaign.name LIKE '%pro%' 
                AND campaign.name NOT LIKE '%promo%'
                '''

Unfortunately, my query above returns a separate row for each campaign with data for the conversion actions separately.
How can I retrieve the aggregate data for the campaign with the conversion number for each conversion type like below?


Campaign Campaign Type Week Currency Conversion Action 1 Conversions. Conversion Action 2 Conversions. Conversion Action 3 Conversions.
Campaign 1                                                                            5                                                                         2                                              10
Campaign 2                                                                            2                                                                         1                                              12



I can't query the conversion_action view as the campaign field is not supported on that. 
Any help would be very much appreciated. 

Google Ads API Forum Advisor Prod

unread,
Jun 25, 2020, 2:34:53 PM6/25/20
to da...@redflymarketing.com, adwor...@googlegroups.com
Hi Dave,

Thank you for reaching out. If you add segments.conversion_action_name to your query to pull the conversions for each campaign for each conversion action.

Regards,
Mitchell
Google Ads API Team

ref:_00D1U1174p._5004Q219Phq:ref

Dave D

unread,
Jun 25, 2020, 3:05:09 PM6/25/20
to AdWords API and Google Ads API Forum
Thanks Mitchell
I added it, the problem is, I get a different row for each conversion action.

If we think of it in terms of a row, I want campaign row to show how many conversions from each action there were in the given time period. You can see what I mean with the table/row sample above.

I can do this in the web UI and in the reporting interface in the web UI, I just can't figure out how to do it with the GAQL query.

Google Ads API Forum Advisor Prod

unread,
Jun 26, 2020, 9:15:00 AM6/26/20
to da...@redflymarketing.com, adwor...@googlegroups.com
Hi Dave,

Thank you for clarifying. Unfortunately, that layout is not available in the API. I have created a feature request on your behalf so please keep an eye on our Developer Blog for information on future releases.
Reply all
Reply to author
Forward
0 new messages