Get Google Ads Dynamic Ad Targets via Ads API?

71 views
Skip to first unread message

Cory Harkins

unread,
Jun 9, 2020, 5:46:01 PM6/9/20
to AdWords API and Google Ads API Forum
Hello,

I'm attempting to get the Dynamic Ad Targets for a specific adGroup via an API query but I cannot seem to find the exact query to get me there. 
I have the adGroup ID but nothing in the API is clicking for me to get that Ad Group's targets.

Google Ads API Forum Advisor Prod

unread,
Jun 10, 2020, 2:36:52 PM6/10/20
to cory.h...@gmail.com, adwor...@googlegroups.com

Hi Cory,

Thanks for reaching out. With regards to your concern, you can use the AdGroupCriterionService.GetAdGroupCriterion to fetch your WebPage criteria that were created purposely for triggering your Dynamic Ads Target. Please refer to this code example but replacing it with the AdGroupCriterionService and adding AdGroupCriterionField.Parameter to my selector.

Thanks,
Nirmita Patel Google Ads Team


 

ref:_00D1U1174p._5004Q20Xbca:ref

Cory Harkins

unread,
Jun 10, 2020, 4:26:28 PM6/10/20
to AdWords API and Google Ads API Forum
I believe, using your advice, I've started with this query:

 string query = $@"SELECT 
                ad_group.id, ad_group_criterion.ad_group,
                ad_group_criterion.criterion_id, ad_group_criterion.negative,
                ad_group_criterion.keyword.text, ad_group_criterion.keyword.match_type, 
                ad_group_criterion.webpage.criterion_name
                FROM ad_group_criterion WHERE ad_group.id = {adGroupId}";

Cory Harkins

unread,
Jun 10, 2020, 5:07:42 PM6/10/20
to AdWords API and Google Ads API Forum
To pivot off this question. 
Is there a way to add and remove these targets through the API?


On Wednesday, June 10, 2020 at 2:36:52 PM UTC-4, adsapiforumadvisor wrote:

Google Ads API Forum Advisor Prod

unread,
Jun 11, 2020, 12:53:49 PM6/11/20
to cory.h...@gmail.com, adwor...@googlegroups.com

Hi Cory,

Thanks for reaching out.  You can use the AdGroupCriterionService.MutateAdGroupCriterion using AdgrouCriterionOpration for adding and removing ad group criterion. We do not have exact sample code example but you may refer to this code example to add targeting criterion but replacing it with the AdGroupCriterionopration instead of CampaignCriterionOperation.

Let me know if you have any questions.



Thanks,
Nirmita Patel Google Ads Team



ref:_00D1U1174p._5004Q20Xbca:ref

Cory Harkins

unread,
Jun 15, 2020, 11:41:05 PM6/15/20
to AdWords API and Google Ads API Forum
I'm so lost on this one. 
Even your code sample is difficult for me. 

Are there any steps you could provide? Code isn't necessary but what specifically to call in the API would help. 

Google Ads API Forum Advisor Prod

unread,
Jun 16, 2020, 3:14:14 PM6/16/20
to cory.h...@gmail.com, adwor...@googlegroups.com
Hi Cory,

Thanks for reaching out.  With regards to your concern, you could use dynamic_search_ads_search_term_view resource and segment based on the web page. Let us know if this help.
Reply all
Reply to author
Forward
0 new messages