Bu kılavuzda, Google Ads Sorgu Dili sorgularının Google Ads kullanıcı arayüzündeki ekranlarla aynı verileri nasıl döndüreceğinizi ve değerleri artırır. Bu sorguları olduğu gibi veya kendi özelleştirilmiş sorgularınızı oluşturmanıza yardımcı olur.
Google Ads kullanıcı arayüzü ekranlarını kopyalama
Bu bölümde, varsayılan verilerle aynı verileri döndüren API sorguları gösterilmektedir Google Ads kullanıcı arayüzü ekranlarında görüntülenebilir. Düzgün çalışmaya devam eden Google Ads'e benzer şekilde metrikler ve veriler gösterdiğinde bu sorgular, API'den alınan benzer verilerdir.
Kampanyalar
Kullanıcı arayüzündeki varsayılan Kampanyalara genel bakış ekranı.
kullanıcı arayüzü ekranı
API sorgusu
GAQL (GAQL)
SELECT campaign.name, campaign_budget.amount_micros, campaign.status, campaign.optimization_score, campaign.advertising_channel_type, metrics.clicks, metrics.impressions, metrics.ctr, metrics.average_cpc, metrics.cost_micros, campaign.bidding_strategy_type FROM campaign WHERE segments.date DURING LAST_7_DAYS AND campaign.status != 'REMOVED'
cURL
curl -f --request POST "https://googleads.googleapis.com/v${API_VERSION}/customers/${CUSTOMER_ID}/googleAds:searchStream" \ --header "Content-Type: application/json" \ --header "developer-token: ${DEVELOPER_TOKEN}" \ --header "login-customer-id: ${MANAGER_CUSTOMER_ID}" \ --header "Authorization: Bearer ${OAUTH2_ACCESS_TOKEN}" \ --data '{ "query": " SELECT campaign.name, campaign_budget.amount_micros, campaign.status, campaign.optimization_score, campaign.advertising_channel_type, metrics.clicks, metrics.impressions, metrics.ctr, metrics.average_cpc, metrics.cost_micros, campaign.bidding_strategy_type FROM campaign WHERE segments.date DURING LAST_7_DAYS AND campaign.status != 'REMOVED' " }'
Reklam grupları
Kullanıcı arayüzündeki varsayılan Reklam gruplarına genel bakış ekranı.
kullanıcı arayüzü ekranı
API sorgusu
GAQL (GAQL)
SELECT ad_group.name, campaign.name, ad_group.status, ad_group.type, metrics.clicks, metrics.impressions, metrics.ctr, metrics.average_cpc, metrics.cost_micros FROM ad_group WHERE segments.date DURING LAST_7_DAYS AND ad_group.status != 'REMOVED'
cURL
curl -f --request POST "https://googleads.googleapis.com/v${API_VERSION}/customers/${CUSTOMER_ID}/googleAds:searchStream" \ --header "Content-Type: application/json" \ --header "developer-token: ${DEVELOPER_TOKEN}" \ --header "login-customer-id: ${MANAGER_CUSTOMER_ID}" \ --header "Authorization: Bearer ${OAUTH2_ACCESS_TOKEN}" \ --data '{ "query": " SELECT ad_group.name, campaign.name, ad_group.status, ad_group.type, metrics.clicks, metrics.impressions, metrics.ctr, metrics.average_cpc, metrics.cost_micros FROM ad_group WHERE segments.date DURING LAST_7_DAYS AND ad_group.status != 'REMOVED' " }'
Reklamlar
Kullanıcı arayüzündeki varsayılan Reklamlara genel bakış ekranı.
Bu sorgunun özellikle tek tek bileşenleri getirdiğine dikkat edin. ekranda birlikte oluşturulan bir Genişletilmiş Metin Reklam'ın Reklam sütunu.
kullanıcı arayüzü ekranı
API sorgusu
GAQL (GAQL)
SELECT ad_group_ad.ad.expanded_text_ad.headline_part1, ad_group_ad.ad.expanded_text_ad.headline_part2, ad_group_ad.ad.expanded_text_ad.headline_part3, ad_group_ad.ad.final_urls, ad_group_ad.ad.expanded_text_ad.description, ad_group_ad.ad.expanded_text_ad.description2, campaign.name, ad_group.name, ad_group_ad.policy_summary.approval_status, ad_group_ad.ad.type, metrics.clicks, metrics.impressions, metrics.ctr, metrics.average_cpc, metrics.cost_micros FROM ad_group_ad WHERE segments.date DURING LAST_7_DAYS AND ad_group_ad.status != 'REMOVED'
cURL
curl -f --request POST "https://googleads.googleapis.com/v${API_VERSION}/customers/${CUSTOMER_ID}/googleAds:searchStream" \ --header "Content-Type: application/json" \ --header "developer-token: ${DEVELOPER_TOKEN}" \ --header "login-customer-id: ${MANAGER_CUSTOMER_ID}" \ --header "Authorization: Bearer ${OAUTH2_ACCESS_TOKEN}" \ --data '{ "query": " SELECT ad_group_ad.ad.expanded_text_ad.headline_part1, ad_group_ad.ad.expanded_text_ad.headline_part2, ad_group_ad.ad.expanded_text_ad.headline_part3, ad_group_ad.ad.final_urls, ad_group_ad.ad.expanded_text_ad.description, ad_group_ad.ad.expanded_text_ad.description2, campaign.name, ad_group.name, ad_group_ad.policy_summary.approval_status, ad_group_ad.ad.type, metrics.clicks, metrics.impressions, metrics.ctr, metrics.average_cpc, metrics.cost_micros FROM ad_group_ad WHERE segments.date DURING LAST_7_DAYS AND ad_group_ad.status != 'REMOVED' " }'
Arama ağı anahtar kelimeleri
Kullanıcı arayüzündeki varsayılan arama ağı anahtar kelimelerine genel bakış ekranı.
kullanıcı arayüzü ekranı
API sorgusu
GAQL (GAQL)
SELECT ad_group_criterion.keyword.text, campaign.name, ad_group.name, ad_group_criterion.system_serving_status, ad_group_criterion.keyword.match_type, ad_group_criterion.approval_status, ad_group_criterion.final_urls, metrics.clicks, metrics.impressions, metrics.ctr, metrics.average_cpc, metrics.cost_micros FROM keyword_view WHERE segments.date DURING LAST_7_DAYS AND ad_group_criterion.status != 'REMOVED'
cURL
curl -f --request POST "https://googleads.googleapis.com/v${API_VERSION}/customers/${CUSTOMER_ID}/googleAds:searchStream" \ --header "Content-Type: application/json" \ --header "developer-token: ${DEVELOPER_TOKEN}" \ --header "login-customer-id: ${MANAGER_CUSTOMER_ID}" \ --header "Authorization: Bearer ${OAUTH2_ACCESS_TOKEN}" \ --data '{ "query": " SELECT ad_group_criterion.keyword.text, campaign.name, ad_group.name, ad_group_criterion.system_serving_status, ad_group_criterion.keyword.match_type, ad_group_criterion.approval_status, ad_group_criterion.final_urls, metrics.clicks, metrics.impressions, metrics.ctr, metrics.average_cpc, metrics.cost_micros FROM keyword_view WHERE segments.date DURING LAST_7_DAYS AND ad_group_criterion.status != 'REMOVED' " }'
Arama terimleri
Kullanıcı arayüzündeki varsayılan arama terimlerine genel bakış ekranı.
kullanıcı arayüzü ekranı
API sorgusu
GAQL (GAQL)
SELECT search_term_view.search_term, segments.keyword.info.match_type, search_term_view.status, campaign.name, ad_group.name, metrics.clicks, metrics.impressions, metrics.ctr, metrics.average_cpc, metrics.cost_micros, campaign.advertising_channel_type FROM search_term_view WHERE segments.date DURING LAST_7_DAYS
cURL
curl -f --request POST "https://googleads.googleapis.com/v${API_VERSION}/customers/${CUSTOMER_ID}/googleAds:searchStream" \ --header "Content-Type: application/json" \ --header "developer-token: ${DEVELOPER_TOKEN}" \ --header "login-customer-id: ${MANAGER_CUSTOMER_ID}" \ --header "Authorization: Bearer ${OAUTH2_ACCESS_TOKEN}" \ --data '{ "query": " SELECT search_term_view.search_term, segments.keyword.info.match_type, search_term_view.status, campaign.name, ad_group.name, metrics.clicks, metrics.impressions, metrics.ctr, metrics.average_cpc, metrics.cost_micros, campaign.advertising_channel_type FROM search_term_view WHERE segments.date DURING LAST_7_DAYS " }'
Kitleler
Kullanıcı arayüzündeki varsayılan Kitlelere genel bakış ekranı.
Reporting API'nin kitleleri ölçüt kimliklerine göre döndürdüğünü unutmayın. Şunları almak için:
referans tablolarında belirtilen kimliklere bakmak için
Kodlar ve biçimler sayfası. Şunları yapabilirsiniz:
hangi ölçüt türünü belirlemek için ad_group_criterion.type
alanını kaldırın
tabloya değineceğiz.
kullanıcı arayüzü ekranı
API sorgusu
GAQL (GAQL)
SELECT ad_group_criterion.resource_name, ad_group_criterion.type, campaign.name, ad_group.name, ad_group_criterion.system_serving_status, ad_group_criterion.bid_modifier, metrics.clicks, metrics.impressions, metrics.ctr, metrics.average_cpc, metrics.cost_micros, campaign.advertising_channel_type FROM ad_group_audience_view WHERE segments.date DURING LAST_7_DAYS
cURL
curl -f --request POST "https://googleads.googleapis.com/v${API_VERSION}/customers/${CUSTOMER_ID}/googleAds:searchStream" \ --header "Content-Type: application/json" \ --header "developer-token: ${DEVELOPER_TOKEN}" \ --header "login-customer-id: ${MANAGER_CUSTOMER_ID}" \ --header "Authorization: Bearer ${OAUTH2_ACCESS_TOKEN}" \ --data '{ "query": " SELECT ad_group_criterion.resource_name, ad_group_criterion.type, campaign.name, ad_group.name, ad_group_criterion.system_serving_status, ad_group_criterion.bid_modifier, metrics.clicks, metrics.impressions, metrics.ctr, metrics.average_cpc, metrics.cost_micros, campaign.advertising_channel_type FROM ad_group_audience_view WHERE segments.date DURING LAST_7_DAYS " }'
Yaş (Demografi)
Kullanıcı arayüzündeki varsayılan Yaş demografisine genel bakış ekranı.
kullanıcı arayüzü ekranı
API sorgusu
GAQL (GAQL)
SELECT ad_group_criterion.age_range.type, campaign.name, ad_group.name, ad_group_criterion.system_serving_status, ad_group_criterion.bid_modifier, metrics.clicks, metrics.impressions, metrics.ctr, metrics.average_cpc, metrics.cost_micros, campaign.advertising_channel_type FROM age_range_view WHERE segments.date DURING LAST_7_DAYS
cURL
curl -f --request POST "https://googleads.googleapis.com/v${API_VERSION}/customers/${CUSTOMER_ID}/googleAds:searchStream" \ --header "Content-Type: application/json" \ --header "developer-token: ${DEVELOPER_TOKEN}" \ --header "login-customer-id: ${MANAGER_CUSTOMER_ID}" \ --header "Authorization: Bearer ${OAUTH2_ACCESS_TOKEN}" \ --data '{ "query": " SELECT ad_group_criterion.age_range.type, campaign.name, ad_group.name, ad_group_criterion.system_serving_status, ad_group_criterion.bid_modifier, metrics.clicks, metrics.impressions, metrics.ctr, metrics.average_cpc, metrics.cost_micros, campaign.advertising_channel_type FROM age_range_view WHERE segments.date DURING LAST_7_DAYS " }'
Cinsiyet (Demografi)
Kullanıcı arayüzündeki varsayılan Cinsiyet demografisine genel bakış ekranı.
kullanıcı arayüzü ekranı
API sorgusu
GAQL (GAQL)
SELECT ad_group_criterion.gender.type, campaign.name, ad_group.name, ad_group_criterion.system_serving_status, ad_group_criterion.bid_modifier, metrics.clicks, metrics.impressions, metrics.ctr, metrics.average_cpc, metrics.cost_micros, campaign.advertising_channel_type FROM gender_view WHERE segments.date DURING LAST_7_DAYS
cURL
curl -f --request POST "https://googleads.googleapis.com/v${API_VERSION}/customers/${CUSTOMER_ID}/googleAds:searchStream" \ --header "Content-Type: application/json" \ --header "developer-token: ${DEVELOPER_TOKEN}" \ --header "login-customer-id: ${MANAGER_CUSTOMER_ID}" \ --header "Authorization: Bearer ${OAUTH2_ACCESS_TOKEN}" \ --data '{ "query": " SELECT ad_group_criterion.gender.type, campaign.name, ad_group.name, ad_group_criterion.system_serving_status, ad_group_criterion.bid_modifier, metrics.clicks, metrics.impressions, metrics.ctr, metrics.average_cpc, metrics.cost_micros, campaign.advertising_channel_type FROM gender_view WHERE segments.date DURING LAST_7_DAYS " }'
Konumlar
Kullanıcı arayüzündeki varsayılan Konumlar'a genel bakış ekranı.
Reporting API'nin, konumları ölçüt kimliklerine göre döndürdüğünü unutmayın. Şunları almak için:
görünen adlarını arayın.
Coğrafi hedefte campaign_criterion.location.geo_target_constant
verilerini hariç tutun veya
geo_target_constant
kaynak.
kullanıcı arayüzü ekranı
API sorgusu
GAQL (GAQL)
SELECT campaign_criterion.location.geo_target_constant, campaign.name, campaign_criterion.bid_modifier, metrics.clicks, metrics.impressions, metrics.ctr, metrics.average_cpc, metrics.cost_micros FROM location_view WHERE segments.date DURING LAST_7_DAYS AND campaign_criterion.status != 'REMOVED'
cURL
curl -f --request POST "https://googleads.googleapis.com/v${API_VERSION}/customers/${CUSTOMER_ID}/googleAds:searchStream" \ --header "Content-Type: application/json" \ --header "developer-token: ${DEVELOPER_TOKEN}" \ --header "login-customer-id: ${MANAGER_CUSTOMER_ID}" \ --header "Authorization: Bearer ${OAUTH2_ACCESS_TOKEN}" \ --data '{ "query": " SELECT campaign_criterion.location.geo_target_constant, campaign.name, campaign_criterion.bid_modifier, metrics.clicks, metrics.impressions, metrics.ctr, metrics.average_cpc, metrics.cost_micros FROM location_view WHERE segments.date DURING LAST_7_DAYS AND campaign_criterion.status != 'REMOVED' " }'
Coğrafi sabitleri arama
Kodlar ve biçimler sayfası, referans tablolarına sahip olacaktır. Ancak, Google Ads Sorgu Dili'ni kullanarak bazı sabit değerleri dinamik olarak arayabilir.
Bu örnekte, bir konumun kaynak adına veya konumuna göre nasıl aranacağı gösterilmektedir görünen ad.
Kaynak adına göre
Mountain View, CA'yı geoTargetConstants/1014044
kaynak adıyla arayın.
GAQL (GAQL)
SELECT geo_target_constant.canonical_name, geo_target_constant.country_code, geo_target_constant.id, geo_target_constant.name, geo_target_constant.status, geo_target_constant.target_type FROM geo_target_constant WHERE geo_target_constant.resource_name = 'geoTargetConstants/1014044'
cURL
curl -f --request POST "https://googleads.googleapis.com/v${API_VERSION}/customers/${CUSTOMER_ID}/googleAds:searchStream" \ --header "Content-Type: application/json" \ --header "developer-token: ${DEVELOPER_TOKEN}" \ --header "login-customer-id: ${MANAGER_CUSTOMER_ID}" \ --header "Authorization: Bearer ${OAUTH2_ACCESS_TOKEN}" \ --data "{ \"query\": \" SELECT geo_target_constant.canonical_name, geo_target_constant.country_code, geo_target_constant.id, geo_target_constant.name, geo_target_constant.status, geo_target_constant.target_type FROM geo_target_constant WHERE geo_target_constant.resource_name = 'geoTargetConstants/1014044' \" }"
Görünen ada göre
"Mountain View"a bak Amerika Birleşik Devletleri'nde bir şehir adı olarak bilinir.
GAQL (GAQL)
SELECT geo_target_constant.canonical_name, geo_target_constant.country_code, geo_target_constant.id, geo_target_constant.name, geo_target_constant.status, geo_target_constant.target_type FROM geo_target_constant WHERE geo_target_constant.country_code = 'US' AND geo_target_constant.target_type = 'City' AND geo_target_constant.name = 'Mountain View' AND geo_target_constant.status = 'ENABLED'
cURL
curl -f --request POST "https://googleads.googleapis.com/v${API_VERSION}/customers/${CUSTOMER_ID}/googleAds:searchStream" \ --header "Content-Type: application/json" \ --header "developer-token: ${DEVELOPER_TOKEN}" \ --header "login-customer-id: ${MANAGER_CUSTOMER_ID}" \ --header "Authorization: Bearer ${OAUTH2_ACCESS_TOKEN}" \ --data "{ \"query\": \" SELECT geo_target_constant.canonical_name, geo_target_constant.country_code, geo_target_constant.id, geo_target_constant.name, geo_target_constant.status, geo_target_constant.target_type FROM geo_target_constant WHERE geo_target_constant.country_code = 'US' AND geo_target_constant.target_type = 'City' AND geo_target_constant.name = 'Mountain View' AND geo_target_constant.status = 'ENABLED' \" }"