借助 Google Ads API,您可以设计查询以获取所需的酒店广告报告。 然后,您可以将这些查询合并到您的客户端应用程序中。
前提条件
酒店广告基本查询
查看这些查询示例,以熟悉如何使用适用于酒店的 Google Ads API 广告报告。
获取点击次数指标
以下示例查询返回酒店获得的点击次数 效果视图
SELECT metrics.clicks
FROM hotel_performance_view
查询结果将如下所示:
{
"results": [
{
"metrics": {
"clicks": "78090"
},
"hotelPerformanceView": {
"resourceName": "customers/1234567890/hotelPerformanceView"
}
}
],
"totalResultsCount": "1",
"fieldMask": "metrics.clicks"
}
获取细分的点击次数指标
以下酒店效果视图查询示例可获取点击次数和细分 按酒店 ID 显示搜索结果。
SELECT
segments.partner_hotel_id,
metrics.clicks
FROM hotel_performance_view
查询结果将类似于以下 JSON 字符串。
点击次数按“partnerHotelID
”细分,因此可以显示两个或更多个对象
为同一
hotelPerformanceView 返回的值
{
"results": [
{
"metrics": {
"clicks": "7055"
},
"hotelPerformanceView": {
"resourceName": "customers/1234567890/hotelPerformanceView"
},
"segments": {
"partnerHotelId": "1111"
}
},
{
"metrics": {
"clicks": "3047"
},
"hotelPerformanceView": {
"resourceName": "customers/1234567890/hotelPerformanceView"
},
"segments": {
"partnerHotelId": "1112"
}
},
...
]
}
获取广告组指标
以下广告组查询示例会获得 过去 30 天,按日期细分。
SELECT
campaign.name,
campaign.status,
ad_group.name,
segments.date,
metrics.impressions,
metrics.clicks
FROM ad_group
WHERE ad_group.type = HOTEL_ADS
AND segments.date DURING LAST_30_DAYS
查询结果将类似于以下 JSON 字符串。
系统将仅针对符合 WHERE
子句的指标过滤响应
条件。日期字段由 30 天内包含的最后一个日期填充
。
{
"results": [
{
"campaign": {
"resourceName": "customers/123456789/campaigns/23456789",
"name": "test campaign",
"status": "ENABLED"
},
"adGroup": {
"resourceName": "customers/123456789/adGroups/11111111",
"name": "test adgroup"
},
"metrics": {
"clicks": "91",
"impressions": "5145"
},
"segments": {
"date": "2020-05-10"
}
}
]
}
获取已启用的广告组广告
以下广告组广告查询示例将获取将投放的广告组。 对于要投放的任何广告组,广告组的广告、广告组和广告系列都必须 全部启用
SELECT
ad_group.id,
ad_group.name,
ad_group.status,
campaign.name,
campaign.status,
ad_group_ad.status
FROM ad_group_ad
WHERE ad_group_ad.status = ENABLED
AND campaign.status = ENABLED
AND ad_group.status = ENABLED
查询结果将类似于以下 JSON 字符串。
{
"results": [
{
"campaign": {
"resourceName": "customers/123456789/campaigns/23456789",
"name": "test campaign",
"status": "ENABLED"
},
"adGroup": {
"resourceName": "customers/123456789/adGroups/111111111111",
"id": "106121857411",
"name": "test adgroup",
"status": "ENABLED"
},
"adGroupAd": {
"resourceName": "customers/123456789/adGroupAds/111111111111~33333333333",
"status": "ENABLED",
"ad": {
"resourceName": "customers/123456789/ads/77777777777"
}
}
}
]
}
酒店广告报告的实用数据视图
在之前的酒店广告报告 API 中,您可以检索特定报告,
例如效果报告。在 Google Ads API 中,此类数据
在单独的 *_view
资源中表示,例如 hotel_performance_view
和
hotel_group_view
。本部分介绍了*_view
对酒店广告报告非常有用。另外还提供了示例查询。
请注意,每个 *_view
资源都有特定的资源字段、细分和
指标。请先参阅特定 *_view
资源的文档,然后再
构建查询。
酒店组视图
以下酒店组视图查询示例可获取以下地点中每家酒店的点击次数: 整个酒店信息组树(包括根节点)的信息组 (“所有酒店”)。
SELECT
metrics.clicks,
ad_group_criterion.listing_group.case_value.hotel_id.value
FROM hotel_group_view
查询结果将类似于以下 JSON 字符串。
鉴于未定义根节点(“所有酒店”)的 case_value
,
第一行代表“所有酒店”指标的商品详情
第二行代表子产品信息组的指标
代表“其他”
{
"results": [
{
"metrics": {
"clicks": "5"
},
"adGroupCriterion": {
"resourceName": "customers/1234567890/adGroupCriteria/22222222222~111111111111"
},
"hotelGroupView": {
"resourceName": "customers/1234567890/hotelGroupViews/22222222222~111111111111"
}
},
{
"metrics": {
"clicks": "0"
},
"adGroupCriterion": {
"resourceName": "customers/1234567890/adGroupCriteria/22222222222~111111111112"
"listingGroup": {
"caseValue": {
"hotelId": {
}
}
}
},
"hotelGroupView": {
"resourceName": "customers/1234567890/hotelGroupViews/22222222222~111111111112"
}
},
{
"metrics": {
"clicks": "3"
},
"adGroupCriterion": {
"resourceName": "customers/1234567890/adGroupCriteria/22222222222~111111111113"
"listingGroup": {
"caseValue": {
"hotelId": {
"value": "11111111111111111"
}
}
}
}
},
"hotelGroupView": {
"resourceName": "customers/1234567890/hotelGroupViews/22222222222~111111111113"
}
},
{
"metrics": {
"clicks": "2"
},
"adGroupCriterion": {
"resourceName": "customers/1234567890/adGroupCriteria/22222222222~111111111114"
"listingGroup": {
"caseValue": {
"hotelId": {
"value": "11111111111111112"
}
}
}
}
},
"hotelGroupView": {
"resourceName": "customers/1234567890/hotelGroupViews/22222222222~111111111114"
}
},
]
}
酒店广告效果视图
如果您有以下需求,则酒店效果视图会非常有用 希望使用与非酒店广告系列相关的数据来检索酒店的效果指标, (即使您有基于酒店 ID 的子类)。
以下酒店效果视图查询示例可获取点击次数和细分 按酒店 ID 显示搜索结果。
SELECT
segments.partner_hotel_id,
metrics.clicks
FROM hotel_performance_view
查询结果将类似于以下 JSON 字符串。
点击次数是按“partner_hotel_id
”细分的,因此可以有 2 个或更多个对象
同一酒店效果视图。
{
"results": [
{
"metrics": {
"clicks": "7055"
},
"hotelPerformanceView": {
"resourceName": "customers/1234567890/hotelPerformanceView"
},
"segments": {
"partnerHotelId": "1111"
}
},
{
"metrics": {
"clicks": "3047"
},
"hotelPerformanceView": {
"resourceName": "customers/1234567890/hotelPerformanceView"
},
"segments": {
"partnerHotelId": "1112"
}
},
...
]
}
广告组受众群体视图
如果您满足以下条件,则广告组受众群体视图会非常有用 想要检索附加到广告组的受众群体的效果指标 。
请注意,这是各种类型广告系列的一般视图,而不仅仅是酒店广告系列
广告系列。此视图还提供按以下内容细分搜索结果的功能:
hotel_date_selection_type
,可用于指定酒店日期
或是由 Google 设置的默认搜索日期。如果
如果您按“hotel_date_selection_type
”细分,则只有酒店广告系列的结果是
返回。
以下查询为每行返回一行
ad_group_criterion.user_list.user_list
。
SELECT
ad_group.id,
campaign.id,
ad_group_criterion.user_list.user_list,
segments.device,
segments.hotel_date_selection_type,
metrics.impressions,
metrics.clicks,
metrics.cost_micros,
metrics.conversions,
metrics.all_conversions_value
FROM ad_group_audience_view
查询结果将类似于以下 JSON 字符串。
{
"results": [
{
"campaign": {
"resourceName": "customers/123456789/campaigns/23456789",
"id": "23456789"
},
"metrics": {
"clicks": "0",
"conversions": "0",
"costMicros": "0",
"impressions": "3",
"allConversionsValue": "0"
},
"adGroupCriterion": {
"resourceName": "customers/123456789/adGroupCriteria/23456789~789456",
"userList": {
"userList": "customers/123456789/userLists/456789"
}
},
"adGroupAudienceView": {
"resourceName": "customers/8005193609/adGroupAudienceViews/23456789~789456"
},
"segments": {
"device": "TABLET",
"hotelDateSelectionType": "USER_SELECTED"
}
}
]
}
广告系列受众群体视图
如果您需要满足以下条件,广告系列受众群体视图会非常有用 想要检索附加到广告系列的受众群体的效果指标 。
请注意,这是各种类型广告系列的一般视图,而不仅仅是酒店广告系列
广告系列。此视图还提供按以下内容细分搜索结果的功能:
hotel_date_selection_type
,可用于指定酒店日期
或是由 Google 设置的默认搜索日期。如果
如果您按“hotel_date_selection_type
”细分,则只有酒店广告系列的结果是
返回。
以下查询为每行返回一行
campaign_criterion.user_list.user_list
。
SELECT
campaign.id,
campaign_criterion.user_list.user_list,
segments.device,
segments.hotel_date_selection_type,
metrics.impressions,
metrics.clicks,
metrics.cost_micros,
metrics.conversions,
metrics.all_conversions_value
FROM campaign_audience_view
查询结果将类似于以下 JSON 字符串。
{
"results": [
{
"campaign": {
"resourceName": "customers/123456789/campaigns/23456789",
"id": "23456789"
},
"metrics": {
"clicks": "0",
"conversions": "0",
"costMicros": "0",
"impressions": "3",
"allConversionsValue": "0"
},
"campaignCriterion": {
"resourceName": "customers/123456789/campaignCriteria/23456789~789456",
"userList": {
"userList": "customers/123456789/userLists/456789"
}
},
"campaignAudienceView": {
"resourceName": "customers/8005193609/campaignAudienceViews/23456789~789456"
},
"segments": {
"device": "TABLET",
"hotelDateSelectionType": "USER_SELECTED"
}
}
]
}
实用的酒店广告报告
本部分提供了几种专为酒店广告系列设计的实用报告 广告。
效果报告
这些查询利用酒店效果视图获取效果数据。
借助 hotel_performance_view
,您可以使用 campaign
资源来细分
指标。例如,您可以使用 campaign.id
字段来获取性能数据,
指标。
性能
查询示例:
SELECT
segments.hotel_center_id,
segments.device,
segments.partner_hotel_id,
segments.hotel_check_in_day_of_week,
segments.hotel_date_selection_type,
segments.hotel_length_of_stay,
segments.hotel_booking_window_days,
metrics.search_top_impression_share,
metrics.search_absolute_top_impression_share,
metrics.impressions,
metrics.clicks,
metrics.cost_micros,
metrics.conversions,
metrics.all_conversions_value,
metrics.search_impression_share
FROM hotel_performance_view
JSON 响应示例:
{
"results": [
{
"campaign": {
"resourceName": "customers/123456789/campaigns/23456789"
},
"metrics": {
"clicks": "0",
"conversions": "0.0",
"costMicros": "0",
"impressions": "0",
"searchImpressionShare": "0.0999",
"searchAbsoluteTopImpressionShare": "0.0999",
"searchTopImpressionShare": "0.0999",
"allConversionsValue": "1"
},
"hotelPerformanceView": {
"resourceName": "customers/123456789/hotelPerformanceView"
},
"segments": {
"device": "DESKTOP",
"hotelBookingWindowDays": "3",
"hotelCenterId": "1234",
"hotelCheckInDayOfWeek": "MONDAY",
"hotelDateSelectionType": "USER_SELECTED",
"hotelLengthOfStay": "4",
"partnerHotelId": "123"
}
},
{
"campaign": {
"resourceName": "customers/123456789/campaigns/23456789"
},
"metrics": {
"clicks": "0",
"conversions": "0.0",
"costMicros": "0",
"impressions": "1",
"searchImpressionShare": "1.0",
"searchAbsoluteTopImpressionShare": "0.0999",
"searchTopImpressionShare": "1.0",
"allConversionsValue": "1"
},
"hotelPerformanceView": {
"resourceName": "customers/123456789/hotelPerformanceView"
},
"segments": {
"device": "DESKTOP",
"hotelBookingWindowDays": "3",
"hotelCenterId": "1234",
"hotelCheckInDayOfWeek": "MONDAY",
"hotelDateSelectionType": "USER_SELECTED",
"hotelLengthOfStay": "4",
"partnerHotelId": "123"
}
}
]
}
效果(包含点击类型)
查询示例:
SELECT
segments.click_type,
segments.hotel_center_id,
segments.device,
segments.partner_hotel_id,
segments.hotel_check_in_day_of_week,
segments.hotel_date_selection_type,
segments.hotel_length_of_stay,
segments.hotel_booking_window_days,
metrics.impressions,
metrics.clicks,
metrics.cost_micros,
metrics.conversions,
metrics.all_conversions_value
FROM hotel_performance_view
JSON 响应示例:
{
"results": [
{
"campaign": {
"resourceName": "customers/123456789/campaigns/23456789"
},
"metrics": {
"clicks": "0",
"conversions": "0.0",
"costMicros": "0",
"impressions": "1",
"allConversionsValue": "0.0"
},
"hotelPerformanceView": {
"resourceName": "customers/123456789/hotelPerformanceView"
},
"segments": {
"device": "DESKTOP",
"hotelBookingWindowDays": "0",
"hotelCenterId": "1234",
"hotelCheckInDayOfWeek": "TUESDAY",
"hotelDateSelectionType": "USER_SELECTED",
"hotelLengthOfStay": "4",
"partnerHotelId": "123",
"clickType": "HOTEL_PRICE"
}
},
{
"campaign": {
"resourceName": "customers/123456789/campaigns/23456789"
},
"metrics": {
"clicks": "1",
"conversions": "0.0",
"costMicros": "0",
"impressions": "1",
"allConversionsValue": "0.0"
},
"hotelPerformanceView": {
"resourceName": "customers/123456789/hotelPerformanceView"
},
"segments": {
"device": "DESKTOP",
"hotelBookingWindowDays": "0",
"hotelCenterId": "1234",
"hotelCheckInDayOfWeek": "TUESDAY",
"hotelDateSelectionType": "USER_SELECTED",
"hotelLengthOfStay": "4",
"partnerHotelId": "12345",
"clickType": "HOTEL_PRICE"
}
}
]
}
条件式费率效果报告
以下查询获取效果指标细分:
campaign
hotel_center_id
hotel_country
hotel_rate_rule_id
hotel_rate_type
device
partner_hotel_id
请参阅 HotelRateType
类型说明。
一个查询中可以包含多个细分;但返回的 行数可能会因额外的细分而显著增加。
SELECT
campaign.id,
segments.hotel_center_id,
segments.hotel_country,
segments.hotel_rate_rule_id,
segments.hotel_rate_type,
segments.device,
segments.partner_hotel_id,
metrics.search_top_impression_share,
metrics.search_absolute_top_impression_share,
metrics.impressions,
metrics.clicks,
metrics.cost_micros,
metrics.conversions
FROM hotel_performance_view
查询结果将类似于以下 JSON 字符串。
{
"results": [
{
"campaign": {
"resourceName": "customers/123456789/campaigns/23456789",
"id": "23456789"
},
"metrics": {
"clicks": "1",
"conversions": "0.0",
"costMicros": "0",
"impressions": "24",
"searchAbsoluteTopImpressionShare": "0.0999",
"searchTopImpressionShare": "0.17073170731707318"
},
"hotelPerformanceView": {
"resourceName": "customers/123456789/hotelPerformanceView"
},
"segments": {
"device": "TABLET",
"hotelCenterId": "1234",
"partnerHotelId": "123",
"hotelRateRuleId": "desktop",
"hotelRateType": "PUBLIC_RATE"
}
},
{
"campaign": {
"resourceName": "customers/123456789/campaigns/23456789",
"id": "23456789"
},
"metrics": {
"clicks": "107",
"conversions": "0.0",
"costMicros": "0",
"impressions": "1668",
"searchAbsoluteTopImpressionShare": "0.0999",
"searchTopImpressionShare": "0.3581201665675193"
},
"hotelPerformanceView": {
"resourceName": "customers/123456789/hotelPerformanceView"
},
"segments": {
"device": "TABLET",
"hotelCenterId": "1234",
"partnerHotelId": "1235",
"hotelRateRuleId": "desktop",
"hotelRateType": "PUBLIC_RATE"
}
}
]
}
价格竞争力报告
您可以深入了解您的价格与竞争对手相比如何上 相同的酒店行程。
查询示例:
SELECT
segments.hotel_center_id,
segments.partner_hotel_id,
segments.hotel_price_bucket,
metrics.hotel_average_lead_value_micros,
metrics.hotel_price_difference_percentage
FROM hotel_performance_view
JSON 响应示例:
{
"results": [
{
"metrics": {
"hotelAverageLeadValueMicros": "96416341.829268292",
"hotelPriceDifferencePercentage": "-0.014627310872986811"
},
"hotelPerformanceView": {
"resourceName": "customers/123456789/hotelPerformanceView"
},
"segments": {
"hotelCenterId": "1234",
"partnerHotelId": "123",
"hotelPriceBucket": "LOWEST_TIED"
}
}
]
}
平均预订价格报告
您可以获取计算平均预订价格所需的数据
酒店数(all_conversions_value
除以 conversions
)。
查询示例:
SELECT
segments.hotel_center_id,
segments.partner_hotel_id,
segments.hotel_price_bucket,
metrics.all_conversions_value,
metrics.conversions
FROM hotel_performance_view
JSON 响应示例:
{
"results": [
{
"metrics": {
"allConversionsValue": "123.5",
"conversions": "1"
},
"hotelPerformanceView": {
"resourceName": "customers/123456789/hotelPerformanceView"
},
"segments": {
"hotelCenterId": "1234",
"partnerHotelId": "123",
"hotelPriceBucket": "LOWEST_TIED"
}
}
]
}
受众群体报告
受众群体报告会显示出价调节系数针对 Google Ads 受众群体的效果 列表。如需查看受众群体报告的示例,请参阅广告组一级的查询示例 受众群体视图和广告系列受众群体 View。
酒店对账报告
酒店对账报告包含 酒店预订转化信息,以便与广告客户进行对账 记录。您可以通过批量上传来上传数据,让 Google 知道 预订已取消或完成。此报告中的主要列包括 如下:
界面列 | API 列 | 说明 |
---|---|---|
预订价值 | metrics.value_per_conversions_by_conversion_date |
代码报告的转化价值 |
转化日期 | segments.date |
预订日期 |
佣金率 | metrics.hotel_commission_rate_micros |
您为广告展示机会出价的预订价值所占的百分比 |
佣金费用 |
如果为 |
您应该为房客入住支付的金额或已支付的金额 |