How i can generate KEYWORDS_PERFORMANCE_REPORT via the google ads api?

91 views
Skip to first unread message

thom “devbot”

unread,
Sep 1, 2023, 5:55:15 AM9/1/23
to Google Ads API and AdWords API Forum
Hi Googile team, i am migrating the google adwords api to the ads API and seems SHOPPING_PERFORMANCE_REPORT and KEYWORDS_PERFORMANCE_REPORT is deprecated and i was checking the proper api to migrate. but i am stuck with the current Reporting API.

How i can get the Max CPC value and how i can get all records for months or date ranges? when i use Adwords API, it was very cool as it generate the CSV file for that report, but seems getting these records via API using Google ads api consume a lot of memory issue to save these records temporary.

Can u please advice the best answer?

Thanks

Google Ads API Forum Advisor

unread,
Sep 1, 2023, 6:31:26 AM9/1/23
to cgthomd...@gmail.com, adwor...@googlegroups.com

Hi,

 

Thank you for raising your concern to the Google Ads API team.

 

I understand that you're looking for the reports: SHOPPING_PERFORMANCE_REPORT and KEYWORDS_PERFORMANCE_REPORT. For these reports, kindly refer to the following links:

 

For more information on Reporting via the API, you may refer here. In addition, you can also check this document for guidance on how to specify date ranges for your report.

 

Let me know if you have any questions.
 

This message is in relation to case "ref:_00D1U1174p._5004Q2oA59t:ref"

Thanks,
 
Google Logo Google Ads API Team


thom “devbot”

unread,
Sep 1, 2023, 6:59:05 AM9/1/23
to Google Ads API and AdWords API Forum

Thank you for the updates, but how can I get the MAX CPC value from that reporting query? I did not find the proper fields for this.

Google Ads API Forum Advisor

unread,
Sep 1, 2023, 12:10:06 PM9/1/23
to cgthomd...@gmail.com, adwor...@googlegroups.com

Hi,

Thank you for your response.

Before we can provide the proper guidance for the MAX CPC that you want to get, can you provide us first a screenshot of your UI un-cropped so we can better check the data that you want to query?

Google Ads API Forum Advisor

unread,
Sep 1, 2023, 12:11:15 PM9/1/23
to cgthomd...@gmail.com, adwor...@googlegroups.com
Hi,

In relation to that requested information, you can provide it via Reply privately to author option. If this option is not available, then send it instead on this email address googleadsa...@google.com.

thom “devbot”

unread,
Sep 4, 2023, 12:07:47 PM9/4/23
to Google Ads API and AdWords API Forum
Thanks! Here is a UI code that need to pull the data from the performance.

For google ads performance report: 

$selector->setFields(
array(
'CampaignId',
'Impressions',
'Clicks',
'Cost',
'CpcBid',
'FinalUrls',
'Id',
'AdGroupId',
'SearchTopImpressionShare',
'SearchAbsoluteTopImpressionShare',
'SearchImpressionShare',
'TopImpressionPercentage'
)
);


For the shopping ads performance report from the original Adwords API:


 $selector->setFields(
// array(
// 'OfferId',
// 'ProductTitle',
// 'Clicks',
// 'Cost',
// )
// );



We need to get these fields for our integration features and let me know please the details query.

Thanks

Google Ads API Forum Advisor

unread,
Sep 4, 2023, 4:09:54 PM9/4/23
to cgthomd...@gmail.com, adwor...@googlegroups.com

Hi,

Thank you for coming back to us. I hope you are doing well today.

With regards to your concern, see the information below for references.

For the first one, you may use the campaign reporting (https://developers.google.com/google-ads/api/fields/v14/campaign), you may try it via campaign_query_builder (https://developers.google.com/google-ads/api/fields/v14/campaign_query_builder) and validate using the query_validator (https://developers.google.com/google-ads/api/fields/v14/query_validator). Please see the sample query below.

SELECT campaign.id, metrics.impressions, metrics.clicks, metrics.cost_micros, bidding_strategy.target_spend.cpc_bid_ceiling_micros, campaign.final_url_suffix, metrics.search_top_impression_share, metrics.search_absolute_top_impression_share, metrics.search_impression_share, metrics.top_impression_percentage, campaign_group.id FROM campaign

For the second concern, shopping_performance_view (https://developers.google.com/google-ads/api/fields/v14/shopping_performance_view), try it also via shopping_performance_view_query_builder (https://developers.google.com/google-ads/api/fields/v14/shopping_performance_view_query_builder). Please see the sample query below.

SELECT segments.product_item_id, segments.product_title, metrics.clicks, metrics.cost_micros FROM shopping_performance_view

You may try the above sample query on your end and let us know how it goes, and if this is the one that you are looking for. If there is any more concern, you may still provide the uncropped screenshot from Google Ads API with date filter, for us to further check and validate and also to provide accurate information and recommendations.

Have a great day.
 

thom “devbot”

unread,
Sep 5, 2023, 5:32:35 AM9/5/23
to Google Ads API and AdWords API Forum
Thanks, but how i can get the adgourp id and name, maxCPC for campaign report?

thom “devbot”

unread,
Sep 5, 2023, 5:32:56 AM9/5/23
to Google Ads API and AdWords API Forum
Your sample query doesn't include the adgroupdid and name, etc.

Google Ads API Forum Advisor

unread,
Sep 5, 2023, 7:36:14 AM9/5/23
to cgthomd...@gmail.com, adwor...@googlegroups.com

Hi Thom,

Thank you for the reply.

You may also try the ad_group (https://developers.google.com/google-ads/api/fields/v14/ad_group) report to get this, as the campaign report is one of its attributed resources. You may try the below sample query for this:

SELECT campaign.id, metrics.impressions, metrics.clicks, metrics.cost_micros, bidding_strategy.target_spend.cpc_bid_ceiling_micros, campaign.final_url_suffix, metrics.search_top_impression_share, metrics.search_absolute_top_impression_share, metrics.search_impression_share, metrics.top_impression_percentage, ad_group.id, ad_group.name, campaign.target_cpa.cpc_bid_ceiling_micros, bidding_strategy.maximize_conversion_value.cpc_bid_ceiling_micros, bidding_strategy.maximize_conversion_value.cpc_bid_floor_micros, bidding_strategy.maximize_conversions.cpc_bid_ceiling_micros, bidding_strategy.maximize_conversions.cpc_bid_floor_micros FROM ad_group

However, if this is still not what you are referring to, then you may provide us with the entire UI screenshot, including its customer ID, where you can see the expected data you want to get from the API, so that we can further check this and provide appropriate recommendations to you.

You may then send the requested information via the Reply privately to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead.

thom

unread,
Sep 15, 2023, 6:06:52 AM9/15/23
to Google Ads API Forum Advisor, adwor...@googlegroups.com
Thank you for the update. I've figure out the adwords report, but we are getting empty records from shopping performance view query and i am not sure why we are getting empty records. the customer id that i am using is 7175571818


Thanks & Regards.
Thom.

Google Ads API Forum Advisor

unread,
Sep 19, 2023, 9:01:47 AM9/19/23
to cgthomd...@gmail.com, adwor...@googlegroups.com
Hi Thom,

Thank you for getting back to us.

By reviewing your concern, I understand that you are receiving empty records when executing the "shopping_performance_view" query, and you are uncertain about the cause of these empty results. In order to investigate your issue further, kindly provide us with the complete API logs (request and response with request-id and request header) generated at your end and uncropped UI screenshot of where you are facing the issue.

If you are using a client library and haven't enabled the logging yet, I would request you to enable logging for the specific client library that you are using. You can refer to the guides Java.NetPHPPythonRuby or Perl to enable logging at your end. For REST interface requests, you can enable logging via the curl command by using the -i flag.

You can send the details via Reply privately to the author option, or direct private reply to this email.

thom

unread,
Sep 20, 2023, 5:15:36 AM9/20/23
to Google Ads API Forum Advisor, adwor...@googlegroups.com
Sure, but it doesn't log anything and the api return the 200 response, but empty result.
 $googleAdsServiceClient = $session->getGoogleAdsServiceClient();
$query = "SELECT segments.product_item_id, segments.product_title,
metrics.clicks, metrics.cost_micros FROM shopping_performance_view WHERE segments.date BETWEEN '{$start}' AND '{$end}' LIMIT 10000 ";
//create selectors to get item related with keywords.
$response =
$googleAdsServiceClient->searchStream(CUSTOMER_ID, $query);
it is a code line that i am using.

Thanks & Regards.
Thom.

Google Ads API Forum Advisor

unread,
Sep 21, 2023, 2:31:50 AM9/21/23
to cgthomd...@gmail.com, adwor...@googlegroups.com
Hi,


Thank you for getting back to us.

I understand that you want to get the report for shopping_performance_view. Kindly note that the Google Ads API mirrors the Google Ads UI. Whatever data or feature shows up on the Ads UI, the API should have the same. To assist you better, please provide us the following information :
If you are using a client library and haven't enabled the logging yet, I would request you to enable logging for the specific client library that you are using. You can refer to the guides Java, .NetPHPPythonRuby or Perl to enable logging at your end. For REST interface requests, you can enable logging via the curl command by using the -i flag.
 

thom

unread,
Sep 21, 2023, 4:09:53 AM9/21/23
to Google Ads API Forum Advisor, adwor...@googlegroups.com
Google ads UI also empty data. I think API is okay, but google ads UI not show the shopping performance view data.

Thanks & Regards.
Thom.

Google Ads API Forum Advisor

unread,
Sep 22, 2023, 10:53:09 AM9/22/23
to cgthomd...@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for getting back to us.

Please note that the API is just a reflection of the UI. Since you are not able to see 'shopping performance view' data in the UI, I would recommend reaching out to the Google Ads Product support team as they are better equipped to address your concern. 

Once you can view 'shopping performance view' data in the UI but are unable to retrieve the same data via the API, please feel free to reach out to us.
Reply all
Reply to author
Forward
0 new messages