As with other campaign types, you can use
to retrieve attributes and performance metrics for Smart campaigns.
Smart campaign metrics are available from the
search_term field contains any matching queries that generated
Impressions and clicks of Smart campaigns in last 30 days
The query below 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 query below retrieves the top 10 search terms that have generated the most impressions over the past 30 days, along with their cost.
SELECT campaign.id, campaign.name, segments.date, metrics.impressions, metrics.cost_micros, smart_campaign_search_term_view.search_term FROM smart_campaign_search_term_view ORDER BY metrics.impressions DESC LIMIT 10
Retrieve attributes of a
KeywordThemeConstants are retrieved from a large dataset that is not
customer-specific, it's not possible to scan the entire
resource all at once. To retrieve individual
KeywordThemeConstants, you must
campaign_criterion resource to find
the resource names of the keyword themes associated with your campaigns, then
use those resource names to filter the
SELECT 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
Now use the resource name in the
campaign_criterion.keyword_theme.keyword_theme_constant field in the following
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'