Search code examples
google-analyticsgoogle-sheetsgoogle-apidimensions

Google Analytics reducing results when more dimensions specified


I've just started using the GA API and I'm using the Google Analytics add-on for Sheets to ease the starting up pain with the API and maybe it's worth mentioning. One thing I don't understand are the dimensions' limitations for combining different dimensions together. I'd like to return a result list that has time, deviceCategory, location, pageTitle and then age and/or gender (if the data exists).

So as I increase the amount of dimensions to include in the response, I get fewer and fewer results. So if I use only the date as a dimension, I get a large result and the more dimensions I add, it reduces eventually to 0 results. I imagine it is hiding the results that don't have a certain dimension available but I'd like to have them return null instead of hiding them. I'm specifically interested in this dimension call:

ga:dateHourMinute ga:deviceCategory ga:City ga:pageTitle

then I get results, but then, when I add ga:userGender or ga:userAgeBracket I get 0 results back. Ideally the results would come back with null if they don't have that data, and with those fields if the data does exist. Can someone explain this behavior?


Solution

  • ABOUT DEMOGRAHPICS DATA

    If you're seeing no or little data when querying demographics dimensions it's because:

    • Not enough traffic: your website has low traffic and GA won't show you demographics data so you can't correlate it with individual visitors (privacy concern):

    https://support.google.com/analytics/answer/2799357?hl=en#thresholds

    Thresholds are applied to prevent anyone viewing a report from inferring the demographics or interests of individual users. When a report contains Age, Gender, or Interest Category (as a primary or secondary dimension, or as part of an applied segment), a threshold may be applied and some data may be withheld from the report

    OR

    • No collected data: demographics data is collected from platforms such as DoubleClick or Android advertising, so in theory, it could be that people coming to your website haven't been exposed to those platforms. However, those platforms are so widespread, you're most likely run into the traffic threshold issue (above bullet point) than this one.

    https://support.google.com/analytics/answer/2799357?hl=en#where

    Demographics and interests data may only be available for a subset of your users, and may not represent the overall composition of your traffic: Analytics cannot collect the demographics and interests information if the DoubleClick cookie or the Device Advertising ID is not present, or if no activity profile is included.

    enter image description here

    ABOUT ABSENCE OF RESULTS

    In order to save computing/network resources, Google Analytics won't return certain data entries if:

    • No data for given dimensions: there is no traffic data recorded for the requested dimensions (whether demograhpics, dates, countries etc...)

    OR

    • All metrics = 0: values for all requested metrics are 0. You can change this behaviour by setting the includeEmptyRows flag to FALSE in the API (can't change that behaviour for the UI).