0
votes

I am fetching performance data through BatchGet in the Google Analytics Core V4 API.

With a combination of dimensions

  • I get data: When fetching data for dates X > 2018-02-01
  • I don't get data: When fetching data for dates X < 2018-01-01

Dimensions used:

[
  "ga:date",
  "ga:source",
  "ga:medium",
  "ga:campaign",
  "ga:country",
  "ga:countryIsoCode"
]

Metrics requested: ga:sessions

I have tried to download data for date 2017-10-01 which results in no data.

Using the following dimension sets return data:

[
  "ga:date",
  "ga:source",
  "ga:medium",
  "ga:campaign",
]

or

[
  "ga:date",
  "ga:country",
  "ga:countryIsoCode"
]

I expect to get data for the union of the dimension sets which works, but instead it returns no data for the date.

Why is there no data returned with the union of dimensions?


Update 2019-04-10:

It seems the issue might be related to the data retention period. enter image description here

1
It seems in this case it was related to data retention. However the question remains why the union doesn't return data but the separate requests do. I will add info into OT - Anthony H

1 Answers

0
votes

You are probably coming up against the facts that

a) an individual GA data row doesn't get populated with every dimension and every measure, only the ones relevant to the particular happening that row is tracking, and

b) GA doesn't return default values for the missing dimensions and measures, just refuses to return the row at all if you ask for a missing dimension or measure.

You'll need to pull the data selectively to a staging post (e.g. a Google Sheet) where you can stick it back together intelligently, setting the right default values. It's a complete pain.