In the AdWords API, you can retrieve performance data (metrics) for different criteria from various reports (e.g., the Keywords Performance Report or the Age Range Performance Report).
To provide similar functionality in Google Ads API, each criteria report
is represented by a separate resource. For example, data similar to
the Keywords Performance
Report
is available in the keyword_view
resource.
Unless absolutely necessary, *_view
resources will only contain
a resource_name
field.
Google Ads API clients will need to specify corresponding ad_group_criterion
or
campaign_criterion
fields if any criteria specific data needs to be fetched.
This will allow Google Ads API clients to request ad_group_criterion
or
campaign_criterion
fields and the *_view
resource in the same request to the
GoogleAdsService.SearchStream
method.
Sample query request
SELECT
ad_group_criterion.keyword.text,
ad_group.name,
campaign.name,
metrics.impressions,
metrics.clicks,
metrics.ctr,
metrics.average_cpc
FROM keyword_view
WHERE segments.date DURING LAST_30_DAYS
To retrieve performance data (metrics) for a specific criteria type, specify its
corresponding view resource in the FROM
clause. For example, use
keyword_view
in the FROM
clause and some metrics
fields in the SELECT
clause to retrieve keyword metrics.
You can select fields from parent resources all the way up to customer
from a
criteria view. For example, when selecting FROM
the keyword_view
, you can
request fields from all of the following resources:
ad_group_criterion
ad_group
campaign
customer
You can check what resources can be requested in the above-mentioned way for a
given resource by checking the Attribute Resources row of its reference
page. For example, for keyword_view
, you can find the above information on its
reference page.
Next steps
Learn more about the service for retrieving resource metadata.
Learn more about segmentation.
Learn how to include or exclude rows for resources without metrics.