tpitale/legato

Include empty rows in query results

mjgiarlo opened this issue · 5 comments

https://gist.github.com/mjgiarlo/9961071

This gist shows that the google-api-client returns query results even for rows with 0 pageviews (for instance), and legato does not. It would be great if #results could support an option for filling in these rows.

Here's an example showing the raw json data that is returned by Google Analytics.

https://gist.github.com/tpitale/9962101

I don't plan to support filling in empty data because it's not trivial to determine what gaps there are. If you would like more of an explanation, I can provide one.

I may take some time to investigate what exactly the google-api-client is doing. Perhaps they're using some unpublished parameter to their API.

That would be great. Thanks.

OK, figured it out:

https://developers.google.com/analytics/solutions/articles/backfill_dates

If I removed the pagePath dimension, the 0 rows are filled in.

Interesting. "However it becomes tricky if you query date along with other dimensions. If one of the dates has no data, the API will NOT return an entry for that date. It will just skip to the next available date that contains data." is almost exactly what I would have said for why we don't fill in Legato.

Thanks for sharing that. I'll add a wiki page.