Missing Dates

When running a daily report in the AdSense Management API, you may expect to get a row for each day, regardless of what data is being returned. However, in some cases you may get no data back for a given day, simply because there were no logged events of the requested types.

Dimension: DATE
Metric: CLICKS, EARNINGS

Response:

{
  "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}
}

As you can see, there are no rows being returned for 2014-01-10 or 2014-01-11, since there were no click or earnings events.

Next steps