Learn business growth with Google Analytics 4 Forums Google Analytics 4 Accessing Query Parameters in Google Analytics 4 API Reply To: Accessing Query Parameters in Google Analytics 4 API

  • Benjamin

    2 March 2023 at 5:36 pm

    The incompatibility issue you’re encountering stems from the fact that “pagePathPlusQueryString” and “sessionCampaignName” dimensions belong to different scopes in Google Analytics 4. The “pagePathPlusQueryString” is in the ‘Page’ scope, while “sessionCampaignName” is within the ‘Session’ scope. These scopes are mutually incompatible— you cannot combine them in a single report. Data in GA4 is processed differently based on its scope.

    For a solution, consider separating your reports based on the scope: one with ‘Session’ scope, featuring the “date” and “sessionCampaignName” dimensions, and another with ‘Page’ scope, combining the “date” and “pagePathPlusQueryString”. You can then splice and dice the data from the two separate reports to get the information you need. Alternatively, it may be possible to use other compatible dimensions that serve a similar purpose in your use case.

    Always remember to ensure that the dimensions in your report are all compatible (within the same scope) to avoid errors. This is key when working with Google Analytics 4’s API.