Search query report Google Ads API

245 views
Skip to first unread message

cv

unread,
Jun 26, 2020, 10:47:52 AM6/26/20
to AdWords API and Google Ads API Forum
Hi,

I would like to get below 2 fields mentioned


KeywordIdsegments.keyword.ad_group_criterion
KeywordTextMatchingQuerysegments.keyword.info.text


For this I have used search_term_view and try to get like this
$googleAdsRow->getSegments()->getKeyword()->getInfo(),
$googleAdsRow->getSegments()->getKeyword()->getAdGroupCriterionUnwrapped(),


But its not giving me the values.

Can I know how I can fetch same?

Thanks






Google Ads API Forum Advisor Prod

unread,
Jun 26, 2020, 4:31:55 PM6/26/20
to chirag....@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for reaching out.

For the keyword text, you can use: googleAdsRow.getSegments().getKeyword().getInfo().getText().getValue()

For the ad group criterion ID, you have to get the resource name by using the following: googleAdsRow.getSegments().getKeyword().getAdGroupCriterion().getValue()

As a tip for getting these values, you can print the whole GoogleAdsRow to the console and follow the printed hierarchy.

Regards,
Mitchell
Google Ads API Team

ref:_00D1U1174p._5004Q219gK4:ref

cv

unread,
Jun 27, 2020, 2:38:21 AM6/27/20
to AdWords API and Google Ads API Forum
Hello Mitchell,

Yes this helpful.

I need help how I can achieve this?
As a tip for getting these values, you can print the whole GoogleAdsRow to the console and follow the printed hierarchy.

-> when I tried to print GoogleAdsRow I am not getting any response and eventually it hangs. How I can see in console?


Thanks,

Google Ads API Forum Advisor Prod

unread,
Jun 29, 2020, 10:30:44 AM6/29/20
to chirag....@gmail.com, adwor...@googlegroups.com
Hi,

For Java, I was able to use "System.out.println(googleAdsRow);" while iterating through the rows and this worked as expected. If the report is very large, this would not be advised.
Reply all
Reply to author
Forward
0 new messages