Skip to contents

A built-in collection of queries, mostly for the googleAdsSearch service: default_search(), campaign_sample(), adgroup_sample(), adgroup_sample_1(), hotel_ads_sample(), keyword_sample(), keyword_sample_1(), keyword_sample_2(). Usually these functions are not called stand alone. Often they are used when a constructor of a query based service is called. A 'Google Ads Query Builder' can be found here: https://developers.google.com/google-ads/api/fields/v9/overview_query_builder

Usage

default_search()

campaign_sample()

adgroup_sample()

adgroup_sample_1()

hotel_ads_sample()

keyword_sample()

keyword_sample_1()

keyword_sample_2()

Value

character query statement

Examples

default_search()
#> [1] "SELECT campaign.name, campaign.status,\n           segments.device, metrics.impressions,\n           metrics.clicks, metrics.ctr,\n           metrics.average_cpc, metrics.cost_micros\n           FROM campaign\n           WHERE segments.date DURING LAST_30_DAYS\n           AND metrics.impressions > 0\n           PARAMETERS include_drafts=true"
campaign_sample()
#> [1] "SELECT campaign.name,\n          campaign.status,\n          segments.device,\n          metrics.impressions,\n          metrics.clicks,\n          metrics.ctr,\n          metrics.average_cpc,\n          metrics.cost_micros\n          FROM campaign\n          WHERE segments.date DURING LAST_30_DAYS"
adgroup_sample()
#> [1] "SELECT campaign.id,\n          campaign.name,\n          ad_group.id,\n          ad_group.name,\n          metrics.impressions,\n          metrics.clicks,\n          metrics.cost_micros\n          FROM ad_group\n          WHERE segments.date DURING LAST_7_DAYS"
adgroup_sample_1()
#> [1] "SELECT ad_group.id,\n           ad_group_ad.ad.id,\n           ad_group_ad.ad.expanded_text_ad.headline_part1,\n           ad_group_ad.ad.expanded_text_ad.headline_part2,\n           ad_group_ad.status\n           FROM ad_group_ad\n           WHERE ad_group_ad.ad.type = EXPANDED_TEXT_AD"
hotel_ads_sample()
#> [1] "SELECT campaign.id,\n          campaign.advertising_channel_type,\n          ad_group.id,\n          ad_group.status,\n          metrics.impressions,\n          metrics.hotel_average_lead_value_micros,\n          segments.hotel_check_in_day_of_week,\n          segments.hotel_length_of_stay\n          FROM hotel_performance_view\n          WHERE segments.date DURING LAST_7_DAYS\n          AND campaign.advertising_channel_type = 'HOTEL'\n          AND ad_group.status = 'ENABLED'\n          ORDER BY metrics.impressions DESC\n          LIMIT 50"
keyword_sample()
#> [1] "SELECT campaign.id,\n          campaign.name,\n          ad_group.id,\n          ad_group.name,\n          ad_group_criterion.criterion_id,\n          ad_group_criterion.keyword.text,\n          ad_group_criterion.keyword.match_type,\n          metrics.impressions,\n          metrics.clicks,\n          metrics.cost_micros\n          FROM keyword_view\n          WHERE segments.date DURING LAST_7_DAYS\n          AND campaign.advertising_channel_type = 'SEARCH'\n          AND ad_group.status = 'ENABLED'\n          AND ad_group_criterion.status IN ('ENABLED', 'PAUSED')\n          ORDER BY metrics.impressions DESC\n          LIMIT 50"
keyword_sample_1()
#> [1] "SELECT\n          ad_group_criterion.keyword.text,\n          ad_group.name,\n          campaign.name,\n          metrics.impressions,\n          metrics.clicks,\n          metrics.ctr,\n          metrics.average_cpc\n          FROM keyword_view\n          WHERE segments.date DURING LAST_30_DAYS"
keyword_sample_2()
#> [1] "SELECT\n              ad_group.id,\n              ad_group_criterion.type,\n              ad_group_criterion.criterion_id,\n              ad_group_criterion.keyword.text,\n              ad_group_criterion.keyword.match_type\n          FROM ad_group_criterion\n          WHERE ad_group_criterion.type = KEYWORD"