缺少日期
在 AdSense Management API 中生成每日报告时,不管系统返回什么数据,您可能都希望每天的数据显示在一行中。但在某些情况下,您可能无法获得特定日期的返回数据,这仅仅是因为未记录到所请求类型的事件。
维度:DATE
指标:CLICKS
、EARNINGS
响应:
{
"totalMatchedRows": "4",
"headers": [
{ "name": "DATE", "type": "DIMENSION" },
{ "name": "CLICKS", "type": "METRIC_TALLY" },
{ "name": "EARNINGS", "type": "METRIC_CURRENCY", "currency": "USD" }
],
"rows": [
{ "cells":
[ {"value": "2014-01-08"}, {"value": "3"}, {"value": "0.41"} ],
[ {"value": "2014-01-09"}, {"value": "5"}, {"value": "0.49"} ],
[ {"value": "2014-01-12"}, {"value": "2"}, {"value": "0.19"} ],
[ {"value": "2014-01-13"}, {"value": "1"}, {"value": "0.03"} ]
}
],
"totals": {
"cells": [
{}, {"value": "13"}, {"value": "1.12"}
]
},
"averages": {
"cells": [
{}, {"value": "2"}, {"value": "0.28"}
]
},
"startDate": {"year": 2014, "month": 1, "day": 8},
"endDate": {"year": 2021, "month": 1, "day": 13}
}
如您所见,2014-01-10 和 2014-01-11 没有返回任何行,因为没有点击或收入事件。
后续步骤
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-09-09。
[null,null,["最后更新时间 (UTC):2024-09-09。"],[[["Daily AdSense reports may not contain a row for every date if there were no clicks or earnings on that specific day."],["The example response demonstrates missing rows for dates (2014-01-10 and 2014-01-11) with no click or earning events."],["If you specify a date range in your report, be aware you may get an incomplete set of dates back depending on activity."],["The report includes totals and averages for clicks and earnings over the specified date range."]]],["The AdSense Management API daily report may not return data for every day in a specified range. The `DATE` dimension, along with `CLICKS` and `EARNINGS` metrics, can result in missing rows. If no events of the requested type occur on a given day, no data is logged. For example, the provided data from January 8th to 13th, 2014, has no entries for January 10th and 11th because there were no clicks or earnings on those days. The total matched rows indicate 4 days of activity.\n"]]