Search code examples
apigoogle-analyticsreportinguser-activity

In the Google Analytics User Activity reporting API, what does the sampling size of 1 in the JSON response mean?


I'm trying to work out whether the Google Analytics reporting API for the userActivity search returns any sampling on the data.

The documentation for the API: https://developers.google.com/analytics/devguides/reporting/core/v4/rest/v4/userActivity/search

The documentation return response JSON:

{
  "sessions": [
    {
      object(UserActivitySession)
    }
  ],
  "totalRows": number,
  "nextPageToken": string,
  "sampleRate": number
}

For the sampleRate, it states:

This field represents the sampling rate for the given request and is a number between 0.0 to 1.0. See developer guide for details.

But what does 1.0 actually mean? Does it mean it returns 100% of the sessions? The links it provides doesn't actually mention anything about the sample rate as a number.

I've tried to compare the JSON response with the Google Analytics UI, but this didn't confirm whether the data is sampled in the API response.


Solution

  • It means that the dimensions and attributes gathered/calculated are based on 100% of the sessions. If it is say 0.6, then it is only based on 60% of the sessions.