GA4: Data API Response returns 1 row only for 2 (or more) events which have exactly similar data

Viewed 58

I have an event that is sent twice that I want to retrieve from GA4 using RunReportRequest.

The problem is, because both events has the exactly same data (same parameter values), the response I get from RunReportRequest shows only row_count:1, whereas I expect row_count:2, considering my eventCount is 2.

The sample data is constructed as follows and sent to GA4. The only different value is that of Param2. Param1 to Param9 are custom dimensions.

{
    "client_id": "x",
    "events": [
        {
            "name": "EVENT_NAME",
            "params": {
                "engagement_time_msec": "30",
                "session_id": "3",
                "Param1": "Lorem",
                "Param2": "ipsum_1",
                "Param3": "dolor",
                "Param4": "sit",
                "Param5": "amet",
                "Param6": "consectetur",
                "Param7": "adipiscing",
                "Param8": "elit",
                "Param9": "Nunc"
            }
        }
    ]
}

{
    "client_id": "x",
    "events": [
        {
            "name": "EVENT_NAME",
            "params": {
                "engagement_time_msec": "30",
                "session_id": "3",
                "Param1": "Lorem",
                "Param2": "ipsum_2",
                "Param3": "dolor",
                "Param4": "sit",
                "Param5": "amet",
                "Param6": "consectetur",
                "Param7": "adipiscing",
                "Param8": "elit",
                "Param9": "Nunc"
            }
        }
    ]
}

The response I get from BatchRunReportsRequest's second runReportRequest is where the it shows incomplete number of rows. The value of Param1, Param8 and Param9 are exactly the same in the two sets of data above.

reports {
  dimension_headers {
    name: "customEvent:Param1"
  }
  dimension_headers {
    name: "customEvent:Param2"
  }
  dimension_headers {
    name: "customEvent:Param3"
  }
  dimension_headers {
    name: "customEvent:Param4"
  }
  dimension_headers {
    name: "customEvent:Param5"
  }
  dimension_headers {
    name: "customEvent:Param6"
  }
  dimension_headers {
    name: "customEvent:Param7"
  }
  rows {
    dimension_values {
      value: "Lorem"
    }
    dimension_values {
      value: "ipsum_1"
    }
    dimension_values {
      value: "dolor"
    }
    dimension_values {
      value: "sit"
    }
    dimension_values {
      value: "amet"
    }
    dimension_values {
      value: "consectetur"
    }
    dimension_values {
      value: "adipiscing"
    }
  }
  rows {
    dimension_values {
      value: "Lorem"
    }
    dimension_values {
      value: "ipsum_2"
    }
    dimension_values {
      value: "dolor"
    }
    dimension_values {
      value: "sit"
    }
    dimension_values {
      value: "amet"
    }
    dimension_values {
      value: "consectetur"
    }
    dimension_values {
      value: "adipiscing"
    }
  }
  row_count: 2
  metadata {
    currency_code: "JPY"
    time_zone: "Asia/Tokyo"
  }
  kind: "analyticsData#runReport"
}
reports {
  dimension_headers {
    name: "customEvent:Param1"
  }
  dimension_headers {
    name: "customEvent:Param8"
  }
  dimension_headers {
    name: "customEvent:Param9"
  }
  rows {
    dimension_values {
      value: "Lorem"
    }
    dimension_values {
      value: "elit"
    }
    dimension_values {
      value: "Nunc"
    }
  }
  row_count: 1
  metadata {
    currency_code: "JPY"
    time_zone: "Asia/Tokyo"
  }
  kind: "analyticsData#runReport"
}
kind: "analyticsData#batchRunReports"

Can anyone tell me why this happens? Are there any workaround?

Thank you in advance.

1 Answers

Google Analytics reports group dimensions by unique values & sum up metrics. For example, let's say Report A has dimensions of country, region, and city; Report A will have a row like South Africa, Western Cape, and Cape Town (See Dimensions to learn more).

Let's say Report B has just one dimension of country. Report B will not have separate rows for each city in South Africa. Report B will have just one row for South Africa.

In your example, Lorem, elit, and Nunc are shared between the two events. Google Analytics aggregates them to one row. You can add the metric eventCount to both reports. The first report will have 1 eventCount per row. The second report will have 2 eventCount for the second row.

Related