Page Summary
-
Smart campaign metrics and search-term specific metrics are available through specific resources in the Google Ads API.
-
You can query for impressions and clicks for Smart campaigns, including segmentation by date and retrieving top search terms.
-
Retrieving
KeywordThemeConstantsrequires queryingcampaign_criterionfirst to get resource names. -
Smart campaigns have specific reporting functionality requirements outlined in the required minimum functionality document.
-
Various metrics, including per-store data and phone calls segmented by hour, can be retrieved for Smart campaigns.
As with other campaign types, you can use
GoogleAdsService.SearchStream to retrieve attributes and
performance metrics for Smart campaigns.
Smart campaign metrics are available from the campaign
resource, and search-term specific metrics are available from the
smart_campaign_search_term_view resource. In the
smart_campaign_search_term_view, the search_term field
contains any matching queries that generated results. To retrieve the
operational status and eligibility details of a Smart campaign (such as
in-review status, not-eligible reasons, or impression timestamps), use
SmartCampaignSettingService.GetSmartCampaignStatus
as described in Campaign status.
Impressions and clicks of Smart campaigns in the last 30 days
The following query retrieves impressions and clicks for each search term from the last 30 days for all Smart campaigns, segmented by date.
SELECT
campaign.id,
campaign.name,
segments.date,
metrics.impressions,
metrics.clicks,
smart_campaign_search_term_view.search_term
FROM smart_campaign_search_term_view
WHERE segments.date DURING LAST_30_DAYS
Top 10 search terms by impressions
The following query retrieves the top 10 search terms that have generated the
most impressions over the past 30 days, along with their cost. Note that
segments.date is omitted from the SELECT clause so that impressions and
cost are aggregated across the entire 30-day date range per search term.
SELECT
campaign.id,
campaign.name,
metrics.impressions,
metrics.cost_micros,
smart_campaign_search_term_view.search_term
FROM smart_campaign_search_term_view
WHERE segments.date DURING LAST_30_DAYS
ORDER BY metrics.impressions DESC
LIMIT 10
Retrieve attributes of a KeywordThemeConstant
Because KeywordThemeConstants are retrieved from a large dataset that is not
customer-specific, it's not possible to scan the entire
keyword_theme_constant resource all at once. To
retrieve individual KeywordThemeConstants, you must query the
campaign_criterion resource to find the resource names
of the keyword themes associated with your campaigns, then use those resource
names to query the keyword_theme_constant resource.
SELECT
campaign.id,
campaign_criterion.type,
campaign_criterion.status,
campaign_criterion.criterion_id,
campaign_criterion.keyword_theme.keyword_theme_constant
FROM campaign_criterion
WHERE campaign_criterion.type = 'KEYWORD_THEME'
Then use the resource name in the
campaign_criterion.keyword_theme.keyword_theme_constant field in the following
query:
SELECT
keyword_theme_constant.resource_name,
keyword_theme_constant.display_name,
keyword_theme_constant.country_code
FROM keyword_theme_constant
WHERE keyword_theme_constant.resource_name = 'keywordThemeConstants/40804~0'
Reporting functionality requirements
To implement Smart campaigns, your application must satisfy a set of required minimum functionality (RMF).
For reporting specifically, a number of reporting fields must be made available to the end user. Here's how to retrieve the required fields from item number R.20 Campaign Performance in the RMF:
SELECT
campaign.id,
campaign.name,
campaign.advertising_channel_type,
metrics.clicks,
metrics.cost_micros,
metrics.impressions,
metrics.conversions,
metrics.all_conversions
FROM campaign
WHERE campaign.advertising_channel_type = 'SMART'
Here's how to retrieve the required fields from item number R.70 Smart Campaign Search Term View, along with the associated campaign and search term:
SELECT
campaign.id,
campaign.name,
smart_campaign_search_term_view.search_term,
metrics.clicks,
metrics.cost_micros
FROM smart_campaign_search_term_view
Per-store metrics
Here's a query that includes all of the available per-store metrics for Smart campaigns. These fields can also be combined with other fields in a single query:
SELECT
campaign.id,
campaign.name,
campaign.advertising_channel_type,
metrics.all_conversions_from_click_to_call,
metrics.all_conversions_from_directions,
metrics.all_conversions_from_menu,
metrics.all_conversions_from_order,
metrics.all_conversions_from_other_engagement,
metrics.all_conversions_from_store_visit,
metrics.all_conversions_from_store_website
FROM campaign
WHERE campaign.advertising_channel_type = 'SMART'
Phone calls segmented by hour
Here's how to retrieve all phone call metrics between 12:00 PM and 5:00 PM
(segments.hour values 12 through 16, where each integer represents a
1-hour window starting at that hour):
SELECT
campaign.id,
campaign.name,
campaign.advertising_channel_type,
segments.hour,
metrics.phone_calls
FROM campaign
WHERE campaign.advertising_channel_type = 'SMART'
AND segments.hour BETWEEN 12 AND 16