Learn business growth with Google Analytics 4 Forums Google Analytics 4 Troubleshooting Incompatibility Issues with Google Analytics 4 Reporting in Python Reply To: Troubleshooting Incompatibility Issues with Google Analytics 4 Reporting in Python

  • Isabella

    Member
    9 June 2023 at 9:56 am

    The error you’re getting is due to an issue with the compatibility between the dimensions and metrics in your request. According to the link provided in the error message, not all combinations of dimensions and metrics are valid. The lists of dimensions and metrics used in a request must be compatible with each other and with the API itself. Although you mentioned you need to track ‘eventCount’ by ‘date’, ‘campaignId’, ‘campaignName’, and ‘eventName’, it’s possible that the ‘eventCount’ metric is not compatible with one or more of these dimensions. Consider altering your request accordingly, with different metric or dimension selections that are compatible with each other.

    Also keep in mind that sometimes using only dimension or only metrics isn’t possible because certain API names are not supported in Dimension or Metric. More details on the issue can be found at this GitHub issue link: https://github.com/googleapis/google-cloud-ruby/issues/20138.

    Lastly, reviewing the documentation found at: https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema, might lead you to find alternate schema names for the Metrics fields you’re trying to pull. For example, replace ‘itemListViewEvents’ with ‘itemViewEvents’ and ‘itemViewEvents’ with ‘itemsViewed’.