Javascript 谷歌广告报告API获得国家细分
我正在使用node.js调用 我的目标是下载谷歌AdWords账户(或活动)每日支出和国家明细 我正在使用npm软件包 我正在用这段代码初始化APIJavascript 谷歌广告报告API获得国家细分,javascript,node.js,google-ads-api,Javascript,Node.js,Google Ads Api,我正在使用node.js调用 我的目标是下载谷歌AdWords账户(或活动)每日支出和国家明细 我正在使用npm软件包 我正在用这段代码初始化API const client = new GoogleAdsApi({ client_id: config.google.client_id, client_secret: config.google.client_secret, developer_token: config.google.developer_token, }); 初始
const client = new GoogleAdsApi({
client_id: config.google.client_id,
client_secret: config.google.client_secret,
developer_token: config.google.developer_token,
});
初始化和基本用例一切正常。
例如
我可以使用以下代码下载特定日期的活动费用:
const accountSpends = await customer.report({
entity: 'campaign',
attributes: ['campaign.name', 'campaign.id'],
metrics: ['metrics.cost_micros'],
segments: ['segments.date'],
from_date: '2021-05-24',
});
这为我提供了答案
{
customer: {
currency_code: 'COP',
time_zone: 'Europe/Gibraltar',
descriptive_name: 'ACC_NAME',
resource_name: 'customers/14920909727'
},
campaign: {
name: 'MGG-Purch-US-[22.05.2021]',
id: 13208700614,
resource_name: 'customers/14921322727/campaigns/132310614'
},
metrics: { cost_micros: 846915958641 },
segments: { date: '2021-05-24' }
}
但是,我不知道如何通过国家细分得出结果
我曾试图要求在字段中使用此类代码进行国家分类
'campaign.geo_target_type_setting.positive_geo_target_type',
'campaign.geo_target_type_setting.negative_geo_target_type'
这给了我一些数字(7表示正,5表示负)
但我想知道国家代码分类的结果