Learn business growth with Google Analytics 4 Forums Google Analytics 4 Obtaining segmented data from GA4 property report using the Google Analytics API Reply To: Obtaining segmented data from GA4 property report using the Google Analytics API

  • Noah

    Member
    3 June 2023 at 2:49 pm

    Sure thing! While the v1 Beta API deprecates some of the features synonymous with the older Google Analytics API, including the ability to use ‘segments’, it does introduce some powerful new features that might help you out: Filters and Cohorts. The use of the ‘filters’ parameter can essentially recreate much of the ‘segment’ functionality. You can apply these filters to define subsets of your data by including or excluding data based on dimensions or metrics. You’d define filters within the ‘dimensionFilter’ and ‘metricFilter’ parameters of your ‘runReport’ request. Also, the new ‘cohortSpec’ feature can produce cohort analysis reports to help track the behavior of a group of users in your defined cohort over time. Finally, potentially key to your request, you could look into setting up ‘audiences’ in Google Analytics 4 properties, which work like a charm with the new API. You’d use the ‘audience’ feature in your ‘runReport’ request. Check out more in the Google Developers guide.